bridge
bridge copied to clipboard
Auto-imports commit breaks compilation in large project
Environment
- Operating System:
Darwin - Node Version:
v16.13.0 - Nuxt Version:
2.16.0-27277936.ab1c6cb4 - Package Manager:
[email protected] - Bundler:
Webpack - User Config:
target,vue,env,head,css,plugins,storybook,tailwindcss,components,bridge,nitro,buildModules,modules,gtm,image,markdownit,screen,axios,i18n,googleFonts,build,alias,serverMiddleware,generate,router - Runtime Modules:
@nuxtjs/[email protected],@nuxtjs/[email protected],[email protected],@nuxtjs/[email protected],vue-screen/nuxt,portal-vue/nuxt,[email protected],@nuxtjs/[email protected],vue-social-sharing/nuxt - Build Modules:
@nuxtjs/[email protected],@nuxtjs/[email protected],@nuxtjs/[email protected],@nuxtjs/[email protected],@nuxt/[email protected],@pinia/[email protected],~/modules/menu,~/modules/hubspot-properties,~/modules/write-redirects,~/modules/write-robots,@nuxt/[email protected]
Reproduction
Can't reproduce for now
Describe the bug
After pulling any bridge-edge build that comes after this commit (https://github.com/nuxt/framework/commit/f5d1d9a208881bfabd9ba53445a04ef597a99825) breaks both yarn dev and yarn build builds with the following errors:
Module parse failed: Identifier 'useUIState' has already been declared (91:9)
File was processed with these loaders:
* ./node_modules/unplugin/dist/webpack/loaders/transform.js
* ./node_modules/unplugin/dist/webpack/loaders/transform.js
* ./node_modules/babel-loader/lib/index.js
* ./node_modules/vue-loader/lib/index.js
* ./node_modules/unplugin/dist/webpack/loaders/transform.js
You may need an additional loader to handle the result of these loaders.
Additional context
Happens both in my machine and in netlify build environment
Logs
No response
I am getting "Module parse failed: Identifier 'ref' has already been declared"
We're also seeing this issue in Openverse's frontend when attempting the Nuxt bridge upgrade today. I'll try to create a minimal-reproduction branch, but for now the error can be seen on the branch for this PR:
https://github.com/WordPress/openverse-frontend/pull/760
Clone the project, checkout the update/nuxt-bridge-attempt-take-2 branch and run pnpm dev. The errors will be present in the console.
I'll work on a minimal repro example today to see if I can help narrow down the root cause.
are you still experiencing this?
Yes, you can see this on https://github.com/WordPress/openverse-frontend/pull/1292, run pnpm install && pnpm build:only and it will cause lots of import issues.
I tried setting autoImports.global to false, but the configuration for auto imports appears to be basically undocumented so I'm not sure if that's meant to disable auto-imports.
We don't wish to use auto-imports in the WordPress/openverse-frontend project, being able to disable this would be helpful both for evading this bug and getting away from auto-imports.
I started experiencing this issue when upgrading from nuxt bridge 3.0.0-27982868.cf7ca7b to 3.0.0-27998567.a12a710. Is there a workaround?
I just encountered this error with a large Nuxt 2.17 app.
It has not responded for a while, so I am closing it. Reopen is welcome.