nuxt icon indicating copy to clipboard operation
nuxt copied to clipboard

fix(kit): don't use default export of defu

Open tobiasdiez opened this issue 2 years ago • 1 comments

🔗 Linked issue

❓ Type of change

  • [ ] 📖 Documentation (updates to the documentation or readme)
  • [x] 🐞 Bug fix (a non-breaking change that fixes an issue)
  • [ ] 👌 Enhancement (improving an existing functionality like performance)
  • [ ] ✨ New feature (a non-breaking change that adds functionality)
  • [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

For a reason that I don't really understand, I got the following error while using loadNuxt in an external (non-nuxt) vite server:

node-pre-gyp ERR!  TypeError: (0 , import_defu.default) is not a function
node-pre-gyp ERR!     at getOptions (/home/runner/work/JabRefOnline/JabRefOnline/node_modules/@nuxt/kit/dist/index.mjs:136:20)
node-pre-gyp ERR!     at normalizedModule (/home/runner/work/JabRefOnline/JabRefOnline/node_modules/@nuxt/kit/dist/index.mjs:163:28)
node-pre-gyp ERR!     at installModule (/home/runner/work/JabRefOnline/JabRefOnline/node_modules/@nuxt/kit/dist/index.mjs:352:9)
node-pre-gyp ERR!     at async initNuxt (file:///home/runner/work/JabRefOnline/JabRefOnline/node_modules/nuxt/dist/index.mjs:2044:7)
node-pre-gyp ERR!     at async loadNuxt (file:///home/runner/work/JabRefOnline/JabRefOnline/node_modules/nuxt/dist/index.mjs:2077:5)
node-pre-gyp ERR!     at loadNuxt (/home/runner/work/JabRefOnline/JabRefOnline/node_modules/@nuxt/kit/dist/index.mjs:519:19)

For some reason the line in the distributed file, import defu, { defu as defu$1 } from 'defu'; results in these issues. I fixed it locally by using only the name export, and this is what this PR is doing.

📝 Checklist

  • [ ] I have linked an issue or discussion.
  • [ ] I have updated the documentation accordingly.

tobiasdiez avatar Jan 28 '23 07:01 tobiasdiez

CodeSandbox logoCodeSandbox logo  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

codesandbox[bot] avatar Jan 28 '23 07:01 codesandbox[bot]

Thanks everyone for the quick review!

tobiasdiez avatar Jan 30 '23 13:01 tobiasdiez