$ node-dev -r esm -r ./.require.js --no-deps --respawn --no-notify --max-old-space-size=16384 --max-semi-space-size=16384 --noincremental_marking -- ./node_modules/.bin/nuxt
/mnt/Projects/nuxt/hw/node_modules/@nuxt/cli/node_modules/esm/esm.js:1
TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them
at module.exports.q.inited.q.module.utilSafeDefaultProperties (/mnt/Projects/nuxt/hw/node_modules/@nuxt/cli/node_modules/esm/esm.js:1)
at Object.<anonymous> (/mnt/Projects/nuxt/hw/node_modules/@nuxt/cli/node_modules/esm/esm.js:1)
at r (/mnt/Projects/nuxt/hw/node_modules/@nuxt/cli/node_modules/esm/esm.js:1)
at /mnt/Projects/nuxt/hw/node_modules/@nuxt/cli/node_modules/esm/esm.js:1
at /mnt/Projects/nuxt/hw/node_modules/@nuxt/cli/node_modules/esm/esm.js:1
at I (/mnt/Projects/nuxt/hw/node_modules/@nuxt/cli/node_modules/esm/esm.js:1)
at Object.<anonymous> (/mnt/Projects/nuxt/hw/node_modules/@nuxt/cli/node_modules/esm/esm.js:1)
at Generator.next (<anonymous>)
Indeed this utilSafeDefaultProperties is inside ESM:
q.module.utilSafeDefaultProperties:q.module.utilSafeDefaultProperties=function(e){for(var t=arguments.length,r=0;++r<t;)for(var i=arguments[r],n=oe(i),s=0,a=null==n?0:n.length;s<a;s++){var o=n[s];!Ee(i,o)||void 0!==e[o]&&Ee(e,o)||ce(e,i,o)}return e},
But judging on its usage I don't find it special, the only thing I thought about is ESM-on-ESM
Hi @stevefan1999-personal!
We must be tripping over a caller or arguments property but I cannot reproduce. The line you gave replaced with an empty ./.require.js file did not produce the error. Could you create a small repro repo that I can investigate?
@jdalton Oh I think it is resolved, it is actually caused by version desync between my own ESM and Nuxt's ESM, which lags behind ^3.0.84, using a yarn resolution works kind of okay now:
"resolutions": {
"esm": "^3.1.1"
},
Based on my observation, ESM-on-ESM will fail
That's not it as the range ^3.0.84 will pull down 3.1.1. I tried to reproduce using 3.0.84 locally with nuxt using 3.1.1 and could not reproduce either. If you narrow down a repro please feel free to post it.
Update:
Precaution patch https://github.com/standard-things/esm/commit/66784acdc9bd0fad6f6706c743825499a7a5c48e.
First, what mean "ESM-on-ESM"? :D
And yea, for me it fails with this exact error for anything above 3.0.84.
I can't narrow it down too.
I'll try the resolutions. I don't know how it works, but seems to fix the problem and now I'm using 3.2.0.
"resolutions": {
"esm": "^3.2.0"
}
@tunnckoCore Yes, I had applied the same workaround I've forgotten about this and carried on.
What I said about ESM-on-ESM is that if you had different ESM versions running in parallel it will shadow each other and transpile in a horrifically wrong order and this is how my issue was originally opened. Now we break this hell by unifying the version
Thanks.
Hi @tunnckoCore!
If you are able to create a simple repro repo that would help me troubleshoot the issue.
Most helpful comment
@tunnckoCore Yes, I had applied the same workaround I've forgotten about this and carried on.
What I said about ESM-on-ESM is that if you had different ESM versions running in parallel it will shadow each other and transpile in a horrifically wrong order and this is how my issue was originally opened. Now we break this hell by unifying the version