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
Error: require of ES Module x from y is not supported #695
Comments
Hi @oddnugget, I doubt this is still timely, but I ran into a similar issue with a This won't be relevant to you if you aren't writing your cli with TypeScript. |
- pin log4js@6.3.0 until ESM bug is resolved (see oclif/oclif/issues/695) - remove `generate` command as it was not functional - add missing/remove redundant dependencies from lerna packages
- pin log4js@6.3.0 until ESM bug is resolved (see oclif/oclif/issues/695) - remove `generate` command as it was not functional - add missing/remove redundant dependencies from lerna packages
If globby is updated to 13 then oclif cannot find any commands at all 😱 (base) (⎈ |N/A:N/A) % ./bin/dev whoami github/sensilla-cli (main ⚡) Chriss-MacBook-Pro
(node:84017) [ERR_REQUIRE_ESM] Error Plugin: sensilla-cli [ERR_REQUIRE_ESM]: require() of ES Module /Users/crucialfelix/github/sensilla-cli/node_modules/globby/index.js from /Users/crucialfelix/github/sensilla-cli/node_modules/@oclif/core/lib/config/plugin.js not supported.
Instead change the require of index.js in /Users/crucialfelix/github/sensilla-cli/node_modules/@oclif/core/lib/config/plugin.js to a dynamic import() which is available in all CommonJS modules.
module: @oclif/core@1.7.0
task: not loading commands, globby not found // Pin it to 11 and it works again:
"globby": "^11", |
Same issue, downgrading globby to 11.x.x as recommended by @crucialfelix fixed the issue for now. |
It does not work for me when trying to use chalk (5.0.1). Already using globby 11. Downgrade chalk to 4.1.2 working for me.
|
Except globby oclif/oclif#695
Fixed by oclif/core#759 (currently available in |
Greetings,
Im using oclif to build a cli that runs puppeteer and interacts with a webcomponent library that is published with
"type": "module"
, and am getting this error when i try to import the webcomponent.Which is strange to me since all of the examples use es6 import / export syntax. I assume this has something to do with ts-node and that its actually calling require under the hood.
Suffice to say, im wondering if there is a way to import this package and use it together with oclif short of changing the package to use commonjs (which i hesitate to do).
The text was updated successfully, but these errors were encountered: