bridge icon indicating copy to clipboard operation
bridge copied to clipboard

Auto-imports commit breaks compilation in large project

Open Rigo-m opened this issue 3 years ago • 4 comments

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

Rigo-m avatar Dec 17 '21 13:12 Rigo-m

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

razbakov avatar Jan 29 '22 05:01 razbakov

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.

sarayourfriend avatar Jan 31 '22 15:01 sarayourfriend

are you still experiencing this?

danielroe avatar Apr 13 '22 10:04 danielroe

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.

sarayourfriend avatar Apr 20 '22 07:04 sarayourfriend

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?

JerryKusenberger avatar Apr 03 '23 20:04 JerryKusenberger

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

deleteme avatar Jul 26 '23 23:07 deleteme

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

wattanx avatar Jan 05 '24 14:01 wattanx