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.

could not resolve vue-demi (Nuxt 3 deployment on netlify)

See original GitHub issue

Hi team, got this error when trying to deploying (for testing) a Nuxt 3 app with vue-use 4:25:43 PM: > .netlify/functions-internal/server/node_modules/@vueuse/shared/index.mjs:636:14: error: Could not resolve "vue-demi" (mark it as external to exclude it from the bundle, or surround it with try/catch to handle the failure at run-time) 4:25:43 PM: 636 │ require("vue-demi").set(...args); 4:25:43 PM: ╵ ~~~~~~~~~~ 4:25:43 PM: .netlify/functions-internal/server/node_modules/vue-demi/package.json:18:17: note: The module "./lib/index.cjs" was not found on the file system 4:25:43 PM: 18 │ "require": "./lib/index.cjs", 4:25:43 PM: ╵ ~~~~~~~~~~~~~~~~~ 4:25:43 PM:

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
didavid61202commented, Oct 23, 2021

hacky fix: change Netlify’s build command to yarn build && cp node_modules/vue-demi/lib/index.cjs .netlify/functions-internal/server/node_modules/vue-demi/lib/index.cjs. which copy index.cjs from root node-modules to server node_modules.

@antfu seems like when we build .output/ locally with nitro (which is trim by @vercel/nft to keep only used files in node_module?), .output/server/vue-demi/lib/index.cjs was kept. But when build on Netlify, .output/server/vue-demi/lib/index.mjs was kept instead of .cjs (cause by change of import/require statement difference locally vs on Netlify?)

not sure why it’s the case, maybe someone knows more about module system could help. Thanks!

1reaction
Joaojackcommented, Oct 24, 2021

@didavid61202 your hacky fix worked indeed for me thanks 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nuxt 3 Deploy Failed: Rollup failed to resolve import "vue"
Hi all, I've been trying to deploy a Nuxt 3 app for the past few hours, but all attempts are failing. The app...
Read more >
Dependency issue with @nuxtjs/composition-api #76 - GitHub
I'm trying to use @vueuse/core with @nuxtjs/composition-api in my Nuxt project. And I get a error message: This dependency was not found: *...
Read more >
Issue deploying Nuxt static site to Netlify using Github
The issue was that you try to deploy with your local server on Netlify. You'll need to deploy the backend too.
Read more >
Views on Vue - Podcast Addict
New Nuxt 3 Features and the Nuxt 3 Community with Daniel Roe - VUE 188 ... Valeri- Mastering JS Valeri- Will Wight: Books...
Read more >
nuxt: Versions | Openbase
Nuxt's documentation is now written with Nuxt 3's new theming system and the latest Docus ... Issues with vite HMR and vite-node should...
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