Open dalisoft opened 1 year ago
Seems we've forgotten to update the documentation; when using ESM you need to register the loader as well.
node -r ./.pnp.cjs --loader ./.pnp.loader.mjs
@merceyz There no file .pnp.loader.mjs
, where i can get this file? Thank you
yarn config set pnpEnableEsmLoader true
thank you, oh, sorry, yep, i able to fix by two way:
{"type": "module"}
into package.json
then run yarn install
[THIS WORKS BETTER]pnpEnableEsmLoader: true
in .yarnrc.yml
(now whitelisted in repo)Using yarn node SCRIPT
works much stable than node -r
I'll keep this open since we need to update the documentation.
@merceyz https://github.com/yarnpkg/berry/issues/5241#issuecomment-1414390053 did not help. Only adding {type: module}
helped
You also need to run an install after setting that config in your project.
Yes, i know and still not worked as expected. But finally solution I'm did find, that's has been my goal. Thank you for help and useful links
I also encountered this bug. Running the below commands was the only thing that worked for me. YMMV.
yarn config set pnpEnableEsmLoader true
yarn install
Self-service
Describe the bug
To reproduce
Environment
Additional context
No response