Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transform failed with x errors #3

Closed
guilhermecamara opened this issue Jun 3, 2022 · 9 comments
Closed

Transform failed with x errors #3

guilhermecamara opened this issue Jun 3, 2022 · 9 comments

Comments

@guilhermecamara
Copy link

guilhermecamara commented Jun 3, 2022

I'm having this error when building my project:

rendering chunks (3)...[vite-plugin-top-level-await] Transform failed with 209 errors: <stdin>:1:1829: ERROR: The symbol "e" has already been declared <stdin>:1:1831: ERROR: The symbol "t" has already been declared <stdin>:1:1833: ERROR: The symbol "_" has already been declared <stdin>:1:1835: ERROR: The symbol "n" has already been declared <stdin>:1:1837: ERROR: The symbol "i" has already been declared ... error during build: Error: Transform failed with 209 errors: <stdin>:1:1829: ERROR: The symbol "e" has already been declared <stdin>:1:1831: ERROR: The symbol "t" has already been declared <stdin>:1:1833: ERROR: The symbol "_" has already been declared <stdin>:1:1835: ERROR: The symbol "n" has already been declared <stdin>:1:1837: ERROR: The symbol "i" has already been declared ... at failureErrorWithLog (C:\freelance\utxo test app\utxo test app\node_modules\esbuild\lib\main.js:1603:15) at C:\freelance\utxo test app\utxo test app\node_modules\esbuild\lib\main.js:1392:29 at C:\freelance\utxo test app\utxo test app\node_modules\esbuild\lib\main.js:666:9 at handleIncomingPacket (C:\freelance\utxo test app\utxo test app\node_modules\esbuild\lib\main.js:763:9) at Socket.readFromStdout (C:\freelance\utxo test app\utxo test app\node_modules\esbuild\lib\main.js:632:7) at Socket.emit (node:events:520:28) at addChunk (node:internal/streams/readable:315:12) at readableAddChunk (node:internal/streams/readable:289:9) at Socket.Readable.push (node:internal/streams/readable:228:10) at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)

My vue plugins are:

plugins: [ topLevelAwait({ // The export name of top-level await promise for each chunk module promiseExportName: "__tla", // The function to generate import names of top-level await promise in each chunk module promiseImportName: i => ``__tla_${i}`` }), vue(), // https://github.com/vuetifyjs/vuetify-loader/tree/next/packages/vite-plugin vuetify({ autoImport: true, }), wasm({ }) ],

@Menci
Copy link
Owner

Menci commented Jun 3, 2022 via email

@azhuang321
Copy link

hello think you for doing this, i have a problem;
if i use @vitejs/plugin-legacy plugin, this plugin will throw error

vite v2.9.13 building for production...                                                                                                                                                                                       15:48:17
transforming (1300) node_modules\lodash-es\_createCtor.js
 WARN  Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification                                                                                                                 15:48:30  

✓ 1349 modules transformed.                                                                                                                                                                                                   15:48:31
dist/assets/polyfills-legacy.67c34418.js            112.02 KiB / gzip: 44.29 KiB                                                                                                                                              15:48:50
dist/assets/index-legacy.466e9b4f.js                359.50 KiB / gzip: 104.06 KiB                                                                                                                                             15:48:50  
dist/assets/NIM_Web_NIM_v9.2.0-legacy.01eff08b.js   669.90 KiB / gzip: 184.84 KiB                                                                                                                                             15:48:50

 WARN                                                                                                                                                                                                                         15:48:50  
(!) Some chunks are larger than 500 KiB after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/guide/en/#outputmanualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.

rendering chunks (2)...
 ERROR  [vite-plugin-top-level-await] Unexpected top-level statement "ExportDeclaration" in Rollup's output chunk. Please open an issue at https://github.com/Menci/vite-plugin-top-level-await/issues.                       15:48:54  


 ERROR  error during build:                                                                                                                                                                                                   15:48:54  
Error: Unexpected top-level statement "ExportDeclaration" in Rollup's output chunk. Please open an issue at https://github.com/Menci/vite-plugin-top-level-await/issues.
    at raiseUnexpectedNode (E:\Project\wail-chat\frontend\node_modules\vite-plugin-top-level-await\dist\utils\error.js:6:11)
    at E:\Project\wail-chat\frontend\node_modules\vite-plugin-top-level-await\dist\transform.js:36:49
    at Array.filter (<anonymous>)
    at transformModule (E:\Project\wail-chat\frontend\node_modules\vite-plugin-top-level-await\dist\transform.js:26:30)
    at E:\Project\wail-chat\frontend\node_modules\vite-plugin-top-level-await\dist\index.js:64:64
    at Array.map (<anonymous>)
    at Object.generateBundle (E:\Project\wail-chat\frontend\node_modules\vite-plugin-top-level-await\dist\index.js:61:57)
    at async Bundle.generate (E:\Project\wail-chat\frontend\node_modules\rollup\dist\shared\rollup.js:16116:9)
    at async E:\Project\wail-chat\frontend\node_modules\rollup\dist\shared\rollup.js:23732:27
    at async catchUnfinishedHookActions (E:\Project\wail-chat\frontend\node_modules\rollup\dist\shared\rollup.js:23174:20)

@Menci
Copy link
Owner

Menci commented Jun 30, 2022 via email

@azhuang321
Copy link

ok wait please

@azhuang321
Copy link

SORRY it is my fault ,it’s working

@ghost
Copy link

ghost commented Oct 12, 2022

@azhuang321 what was the issue? :)

@amorin-gladia
Copy link

amorin-gladia commented Jan 19, 2023

Same problem here during the build:

[vite-plugin-top-level-await] Error: Transform failed with 4 errors:
<stdin>:1:118: ERROR: The symbol "bc" has already been declared
<stdin>:1:121: ERROR: The symbol "Ui" has already been declared
<stdin>:1:148: ERROR: The symbol "wc" has already been declared
<stdin>:1:160: ERROR: The symbol "ji" has already been declared
    at failureErrorWithLog (/Users/cactus/Documents/Repositories/ui/node_modules/esbuild/lib/main.js:1575:15)
    at /Users/cactus/Documents/Repositories/ui/node_modules/esbuild/lib/main.js:814:29
    at responseCallbacks.<computed> (/Users/cactus/Documents/Repositories/ui/node_modules/esbuild/lib/main.js:680:9)
    at handleIncomingPacket (/Users/cactus/Documents/Repositories/ui/node_modules/esbuild/lib/main.js:735:9)
    at Socket.readFromStdout (/Users/cactus/Documents/Repositories/ui/node_modules/esbuild/lib/main.js:656:7)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Readable.push (node:internal/streams/readable:234:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)

In vite.config.ts :

topLevelAwait({
      // The export name of top-level await promise for each chunk module
      promiseExportName: '__tla',
      // The function to generate import names of top-level await promise in each chunk module
      promiseImportName: (i) => `__tla_${i}`,
    }),

Any idea of what is happening ?

@Menci
Copy link
Owner

Menci commented Feb 5, 2023

@amorin-gladia Are there any example project for reproducing?

@Menci
Copy link
Owner

Menci commented May 20, 2023

Closing since no response.

@Menci Menci closed this as completed May 20, 2023
@Menci Menci closed this as not planned Won't fix, can't repro, duplicate, stale May 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants