-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
I want a package.json that's pre-defined in my template directory.
This package.json specifies "type":"module"
But the init.config.ts script (or .js script) live in this same directory, and thus node picks up this configuration.
This means that I get an error about trying to use require() to load ESM modules:
Must use import to load ES Module: /Users/jwatte/github.com/reve-ai/reve-core/common/_templates/backend-service/init.config.ts
require() of ES modules is not supported.
require() of /Users/jwatte/github.com/reve-ai/reve-core/common/_templates/backend-service/init.config.ts from /Users/jwatte/github.com/reve-ai/reve-core/common/autoinstallers/rush-tools/node_modules/.pnpm/[email protected]_@[email protected][email protected]/node_modules/rush-init-project-plugin/lib/logic/TemplateConfiguration.js is an ES module file as it is a .ts file whose nearest parent package.json contains "type": "module" which defines all .ts files in that package scope as ES modules.
Instead change the requiring code to use import(), or remove "type": "module" from /Users/jwatte/github.com/reve-ai/reve-core/common/_templates/backend-service/package.json.
razhnoff and Woutwo
Metadata
Metadata
Assignees
Labels
No labels