"SyntaxError: Cannot use import statement outside a module" when attempting to build a turborepo app
I have a turbo repo that has a websocket app. I have a package for my redis client so it can be used in all my apps. However when I try to start my websocket app in production I get
I am believe its not transpiling the internal pacakges correctly but unsure how to solve.
Linked the repo below.
https://github.com/ZiiMs/Radiance
Thanks for the help.
GitHub
GitHub - ZiiMs/Radiance: A simple chat app, based on discord.
A simple chat app, based on discord. Contribute to ZiiMs/Radiance development by creating an account on GitHub.
3 Replies
Stack Overflow
Why is 'type: module' in package.json file?
I upgraded the node and built the existing file.
But it didn't build, and there was an error.
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: │
│ ~~/nuxt.
Changing it to module gives me error saying:
Solution
Solved it by removing type module, and adding ts loader to esbuild.