We're not using .mjs but we need __dirname and import CJS internal modules. @std/esm is deprecated so we're migrated but I cannot find the matching options.
Environment
Windows 10 Pro
Node 12.14.1 & npm 6.13.4
esm v3.2.25
More details
My microservice, importing among others internal modules, is using "type": "module" and is not transpiled through Babel
My npm start script is currently running node -r esm src/api/index.js
I was using "@std/esm": "0.26.0", completed with "@std/esm": "cjs" and npm start script was running node -r @std/esm src/api/index.js and it was working pretty well
The migration was motivated by problems with zeit/pkg to try to fix another issue
But still having issue with another previousliy working file
SyntaxError: The requested module '<path/to/project>/node_modules/<another-internal-module-name>/dist/index.js' does not provide an export named 'default'
Any ideas would be appreciate.
P.S.: I already saw other posts like this one, this one and even this one but I don't get the answer
P.P.S: your response time is pretty impressive @jdalton , your work too
Hi,
I'm facing issue while migrating from @std/esm to esm. I saw the post (https://github.com/standard-things/esm/issues/668) but I don't get it.
We're not using
.mjs
but we need__dirname
and import CJS internal modules.@std/esm
is deprecated so we're migrated but I cannot find the matching options.Environment
More details
"type": "module"
and is not transpiled through Babelnpm start
script is currently runningnode -r esm src/api/index.js
"@std/esm": "0.26.0"
, completed with"@std/esm": "cjs"
andnpm start
script was runningnode -r @std/esm src/api/index.js
and it was working pretty wellAttempts
esm
but without specific options (using default ones as told in the issue (https://github.com/standard-things/esm/issues/668))while it is
esm
but with more optionsBut still having issue with another previousliy working file
Any ideas would be appreciate.
P.S.: I already saw other posts like this one, this one and even this one but I don't get the answer P.P.S: your response time is pretty impressive @jdalton , your work too