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.

'setupDevtoolsPlugin' is not exported by `unenv`

See original GitHub issue

Environment

NUXT 3 : 3.0.0-27497374.59593a0 NODE : 16.4.2 pnpm": “^6.32.3”

Reproduction

.

Describe the bug

when normaly build its fine. image

Additional context

my nuxt config not set preset. when im build NITRO_PRESET=cloudflare pnpm build.

Logs

Error like this:

 ERROR  Rollup error: 'setupDevtoolsPlugin' is not exported by node_modules/.pnpm/unenv@0.4.6/node_modules/unenv/runtime/mock/proxy.mjs, imported by node_modules/.pnpm/pinia@2.0.13_d3195e5b5ca92757b2890fe178df3bd1/node_modules/pinia/dist/pinia.mjs

 ERROR  'setupDevtoolsPlugin' is not exported by node_modules/.pnpm/unenv@0.4.6/node_modules/unenv/runtime/mock/proxy.mjs, imported by node_modules/.pnpm/pinia@2.0.13_d3195e5b5ca92757b2890fe178df3bd1/node_modules/pinia/dist/pinia.mjs

  at error (node_modules/.pnpm/rollup@2.70.1/node_modules/rollup/dist/es/shared/rollup.js:1784:30)
  at Module.error (node_modules/.pnpm/rollup@2.70.1/node_modules/rollup/dist/es/shared/rollup.js:12345:16)
  at Module.traceVariable (node_modules/.pnpm/rollup@2.70.1/node_modules/rollup/dist/es/shared/rollup.js:12703:29)
  at ModuleScope.findVariable (node_modules/.pnpm/rollup@2.70.1/node_modules/rollup/dist/es/shared/rollup.js:11333:39)
  at FunctionScope.findVariable (node_modules/.pnpm/rollup@2.70.1/node_modules/rollup/dist/es/shared/rollup.js:6301:38)
  at ChildScope.findVariable (node_modules/.pnpm/rollup@2.70.1/node_modules/rollup/dist/es/shared/rollup.js:6301:38)
  at Identifier.bind (node_modules/.pnpm/rollup@2.70.1/node_modules/rollup/dist/es/shared/rollup.js:7592:40)
  at CallExpression.bind (node_modules/.pnpm/rollup@2.70.1/node_modules/rollup/dist/es/shared/rollup.js:5166:23)
  at CallExpression.bind (node_modules/.pnpm/rollup@2.70.1/node_modules/rollup/dist/es/shared/rollup.js:8774:15)
  at ExpressionStatement.bind (node_modules/.pnpm/rollup@2.70.1/node_modules/rollup/dist/es/shared/rollup.js:5166:23)
  

image

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:4
  • Comments:43 (20 by maintainers)

github_iconTop GitHub Comments

11reactions
danielroecommented, Apr 29, 2022

The cause is that pinia imports setupDevtoolsPlugin from @vue/devtools-api. We deliberately stub out vue devtools on the server. So rollup, in trying to inline this function, fails.

As a workaround, you can do:

import { defineNuxtConfig } from 'nuxt'

export default defineNuxtConfig({
  alias: {
    '@vue/devtools-api': '@vue/devtools-api',
  },
  modules: ['@pinia/nuxt'],
})
4reactions
ma-jahncommented, Aug 17, 2022

Just upgraded to v3.0.0-rc.8-27679173.c688e18 and it’s working!

@danielroe @pi0 Thank you so much for this blazing fast fix!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I fix "the requested module does not provide an export ...
The reason it didn't work is that Vue provides a named export, whereas you are trying to import it as though it had...
Read more >
ES Modules · Nuxt Concepts
For example, when you import sample-library , Node.js will look not for the main but for the exports or module entry in that...
Read more >
@zamiell/typedoc-plugin-not-exported - npm
This TypeDoc plugin can force inclusion of specific symbols (variables) that are not exported, by making them fake exports.
Read more >
Common Issues - Nuxt Vite
Uncaught SyntaxError: The requested module ... does not provide an export named 'default'. Vite has an issue for pre-bundling dependencies ...
Read more >
TIL: Requiring a File that Isn't Exported by a Node Module
I spent easily an hour looking for some sort of guide, digging through the Lodash source on github (not fruitful because their repo...
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