Closed bigbossx closed 1 year ago
Another disgusting problem is that I can't override the version of rc9, because it is an internal dependency of nuxt
Hi, and thanks for sharing the issue. It is super strange one since you are sure Node.js version is 20... If possible would you please sent me a comment in discord (@pi0) so we can check on your system what is going on?
@pi0 thanks your quickly reply!
everything change when nuxt use Resolver
, I have to suspect that there is an incompatibility
ps: please sent me a comment in discord
what is it? what should I do?
Thanks for sharing more info. I think since you are using Nuxt 2 and it might be using an outdated/incompatible version of telemetry or jiti in the dependencies. Your environment supports it but those deps might not.
Can you check jiti version or somehow share your repository with me? Without reproduction i cannot find out what is going wrong
please sent me a comment in discord
ok! I will try to share you a mini reproduct repository. but not now, may be in this weekend when I have free time
@pi0 You are right.
when I use nuxt@2.14.12
. one of key is this._require = createRequire(module)
, and in this case nuxt
use esm as module resolver 👉 see source code.
but esm
seem not support node internal module with prefix. if i use nuxt@2.17.1
or higher version, nuxt remove esm will just use jiti source code, so problem be resolved
I think i should upgrade my nuxt version, to resolve this problem.
btw. I find some issues like this say this is mismatch the compat node version, so I just switch my node version and try again and again, but not working. so I must suggest you should tell other one, it also possible he use outdated/incompatible version like me.
finally, thank you!
Environment
node 14,16,18,20 lts
"nuxt": "~2.14.12"
Reproduction
Describe the bug
I really want to know why I tried almost every node lts version greater than 14 and still get the same error.
However, it is ridiculous that if I directly create a new file just has
console.log(reuqire("node:fs"))
and execution, There will be no mistakes.Is it because nuxt's resolver can't recognize node: prefix instead of node itself? This is a really disgusting question and wasted a lot of my time
Additional context
No response
Logs
No response