Nuxt3 build ERROR [commonjs--resolver]
See original GitHub issueHi, I have problem during building process on Nuxt3. Can somebody help me?
my package.json
{
"devDependencies": {
"nuxt": "3.0.0-rc.11",
},
"dependencies": {
"three": "^0.143.0",
"troisjs": "^0.3.4"
}
}
ℹ Client built in 16353ms 12:01:06
ℹ Building server... 12:01:06
ERROR [commonjs--resolver] Unexpected keyword 'false' 12:01:13
file: /app/node_modules/troisjs/build/trois.module.js:629:13
627: this.addListener("init", cb);
628: },
629: onMounted(cb) {
^
630: this.addListener("mounted", cb);
631: },
ERROR Unexpected keyword 'false'
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:7
Top Results From Across the Web
Nuxt3 nuxi build ERROR [commonjs--resolver]
When i run nuxi dev everything is Ok, but nuxi build occurred this error. > @ build E:\everyday-action\webprint > nuxi build Nuxi 3.0.0...
Read more >Failed to resolve dependencies when starting Nuxt under ...
Unable to build a nuxt 3 app within a yarn 1.x workspace. ... is imported by @vue/runtime-dom?commonjs-external, but could not be resolved ...
Read more >Nuxt 3 APP Failed to resolve module specifier "Vue"
Hi, i`m trying to deploy a nuxt 3 app and I'm getting a blank page, along with the message: Uncaught TypeError: Failed to...
Read more >ES Modules · Nuxt Concepts
This guide helps explain what ES Modules are and how to make a Nuxt app (or upstream library) compatible with ESM. Background ·...
Read more >Publish ESM and CJS in a single package
Error [ERR_REQUIRE_ESM]: require() of ES Module esm-only-package not ... to ship both CJS and ESM formats to make the transition smoother.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

In my case I had <ClientOnly> component in the parent component and I thought child component will inherit from it, but It looks like I was wrong. I take <ClientOnly> directly before <Renderer> in the one component (or .client postfix on component), after that everything works fine. My fault.
I had Nuxt set on hybrid rendering ssr: true. And I had <ClientOnly> component in separate .vue file where was child component renderer.vue inside them I had <Renderer> troisjs component. This was wrong ,after I put <ClientComponent> directly inside renderer.vue before <Renderer>, everything works fine. (Remember you must have build: { transpile:[‘troijs’] } as well.)