nuxt / bridge

🌉 Experience Nuxt 3 features on existing Nuxt 2 projects
MIT License
273 stars 29 forks source link

Auto-imports commit breaks compilation in large project #33

Closed Rigo-m closed 9 months ago

Rigo-m commented 2 years ago

Environment


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

razbakov commented 2 years ago

I am getting "Module parse failed: Identifier 'ref' has already been declared"

sarayourfriend commented 2 years ago

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.

danielroe commented 2 years ago

are you still experiencing this?

sarayourfriend commented 2 years ago

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.

JerryKusenberger commented 1 year ago

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?

deleteme commented 1 year ago

I just encountered this error with a large Nuxt 2.17 app.

wattanx commented 9 months ago

It has not responded for a while, so I am closing it. Reopen is welcome.