ibrahimyaacob
ibrahimyaacob12mo ago

Error importing `api` on node application in turborepo

I keep getting this error when setting up on Fastify Server apps in a Turborepo. It appears when i attempt to import the api from the generated https://github.com/ibrahimyaacob92/11-turbo-next-fastify-2/tree/dev
GitHub
GitHub - ibrahimyaacob92/11-turbo-next-fastify-2 at dev
Contribute to ibrahimyaacob92/11-turbo-next-fastify-2 development by creating an account on GitHub.
No description
No description
2 Replies
ian
ian12mo ago
it's being compiled as "commonjs" instead of as a module. I would check the tsconfig against a working demo
ibrahimyaacob
ibrahimyaacobOP12mo ago
hi @ian i built this on top of the turborepo demo, im not that great with tsconfig, but here it is on the fastify server app { "extends": "fastify-tsconfig", "compilerOptions": { "sourceMap": true, "outDir": "./dist", "noImplicitAny": true, "strictNullChecks": true, "strictFunctionTypes": true, "noImplicitThis": true, "noUnusedParameters": true, "noImplicitReturns": true, "allowSyntheticDefaultImports": true, "esModuleInterop": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, // }, "exclude": [ "node_modules" ], "include": [ "./src/*/.ts" ] }

Did you find this page helpful?