Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESM compatibility #80

Open
FND opened this issue Jan 10, 2020 · 1 comment
Open

ESM compatibility #80

FND opened this issue Jan 10, 2020 · 1 comment

Comments

@FND
Copy link
Contributor

FND commented Jan 10, 2020

recent versions of Node (since v13?) refuse to load faucet.config.js for ESM projects, i.e. such with "type": "module" in package.json:

Warning: require() of ES modules is not supported.
require() of …/faucet.config.js from …/node_modules/faucet-pipeline-core/lib/config.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename faucet.config.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from package.json.

renaming the config file (i.e. faucet -c faucet.config.cjs) is a viable workaround, but not very satisfying

@moonglum
Copy link
Member

moonglum commented Jan 14, 2020

As discussed, let's compare that with the approach taken by tools like ESLint, Babel, Rollup, Mocha etc.

It might also be an option to go with something like .faucetrc (cf. 3777779), though it appears that's no longer en vogue.

@FND FND mentioned this issue Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants