You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered the problem of not being able to import files from workspace packages (monorepo), in my case it was the @some/common package, complaining that this is not supported in the ts file.
strapi:build: cache bypass, force executing 9df377beb679af49
strapi:build: [WARN] [@strapi/strapi]: The NODE_ENV is not set to production. This may result in unexpected behavior.
strapi:build: ⠋ Compiling TS src/api/healthcheck/controllers/healthcheck.ts:4:38 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("@some/common")' call instead.
@dbbs/strapi:build: To convert this file to an ECMAScript module, change its file extension to '.mts', or add the field "type": "module" to '/apps/strapi/package.json'.
strapi:build:
strapi:build: import { SettingServiceClient } from '@some/common'
We ask that you please follow the issue template.
A proper issue submission let's us better understand the origin of your bug and therefore help you. We will reopen your issue when we receive the issue following the template guidelines and properly fill out the template. You can see the template guidelines for bug reports here.
Please update the issue with the template and we can reopen this report.
I encountered the problem of not being able to import files from workspace packages (monorepo), in my case it was the @some/common package, complaining that this is not supported in the ts file.
strapi:build: cache bypass, force executing 9df377beb679af49
strapi:build: [WARN] [@strapi/strapi]: The NODE_ENV is not set to production. This may result in unexpected behavior.
strapi:build: ⠋ Compiling TS src/api/healthcheck/controllers/healthcheck.ts:4:38 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("@some/common")' call instead.
@dbbs/strapi:build: To convert this file to an ECMAScript module, change its file extension to '.mts', or add the field
"type": "module"
to '/apps/strapi/package.json'.strapi:build:
strapi:build: import { SettingServiceClient } from '@some/common'
my tsconfig configuration:
The text was updated successfully, but these errors were encountered: