Open zhangHongEn opened 1 week ago
It doesn't work with Vite v5 too. https://stackblitz.com/edit/github-441yb3?file=package.json&terminal=build
I don't think this should work because top-level await cannot be used in CJS (https://github.com/nodejs/node/issues/21267).
Have you tried the build mode?
---- Replied Message ---- | From | @.> | | Date | 12/02/2024 09:28 | | To | vitejs/vite @.> | | Cc | zhn @.>, Author @.> | | Subject | Re: [vitejs/vite] vite6 [commonjs--resolver] node_modules/testb/a.js (1:6): await isn't allowed in non-async function (Issue #18850) |
It doesn't work with Vite v5 too. https://stackblitz.com/edit/github-441yb3?file=package.json&terminal=build
I don't think this should work because top-level await cannot be used in CJS (nodejs/node#21267).
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
Yes, I have.
I don't have a computer with me right now. I'll check it tonight
---- Replied Message ---- | From | @.> | | Date | 12/02/2024 09:33 | | To | vitejs/vite @.> | | Cc | zhn @.>, Author @.> | | Subject | Re: [vitejs/vite] vite6 [commonjs--resolver] node_modules/testb/a.js (1:6): await isn't allowed in non-async function (Issue #18850) |
Yes, I have.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
Describe the bug
Everything works fine with Vite 5.
Top-level await in node_modules. https://github.com/module-federation/vite/issues/201
Reproduction
https://github.com/zhangHongEn/vite-mf-bug
Steps to reproduce
npm install && npm run build
System Info
Used Package Manager
npm
Logs
Validations