question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Nuxt3 build ERROR [commonjs--resolver]

See original GitHub issue

Hi, 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:closed
  • Created a year ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

1reaction
jojcocommented, Oct 27, 2022

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.

0reactions
jojcocommented, Nov 23, 2022

In my case I had component in the parent component and I thought child component will inherit from it, but It looks like I was wrong. I take directly before in the one component (or .client postfix on component), after that everything works fine. My fault.

Could you expand on this? I’m having this issue as well and I’m having trouble following your comment here.

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.)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found