SyntaxError: Unexpected token 'export' when starting production build of Node+Express+Socket app with TURBOREPO (monorepo) #9055
-
SummaryI'm facing an issue when trying to run my Node.js + Express + Socket.io application in production. The app works perfectly in development mode using turbo dev, but when I try to build and start the application in production using npm run build && npm start, I encounter the following error:
Here are the relevant code snippets from the project files: 1. apps/dashboard File: prisma.ts
File: package.json
2. apps/live-stats File: prisma.ts
File: package.json
File: tsconfig.json
3. packages/mysql-database File: src/prisma.ts
File: src/index.ts
File: package.json
File: tsconfig.json
Additional Context: The I have tried several solutions but haven't been able to resolve this issue. Any help would be greatly appreciated. edit: I tried to change tsup config, set Additional informationNo response ExampleNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Express.js isn't able to consume TypeScript directly, which is a limitation of Just-In-Time packages. The Next.js application can handle it since it's using webpack or Turbopack for bundling, but Express.js doesn't have a bundler. You may want to switch to a Compiled Package. |
Beta Was this translation helpful? Give feedback.
Express.js isn't able to consume TypeScript directly, which is a limitation of Just-In-Time packages. The Next.js application can handle it since it's using webpack or Turbopack for bundling, but Express.js doesn't have a bundler. You may want to switch to a Compiled Package.