-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
@vite/plugin-legacy bug with buildPolyfillChunk and const type variable #9618
Comments
Hello @Nepo92. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with |
I also encountered this problem, my project failed to build since yesterday. After looking into it I find that maybe cause by systemjs's 6.12.2 release. It include a "const" statement in "dist/s.min.js" which imported by @vite/plugin-legacy. So we may need wait for its fix or use "resolution" or "overrides" field of package manager as a temporary workaround. |
|
use // vite.config.js
import legacy from '@vitejs/plugin-legacy'
export default {
plugins: [
legacy({
targets: ['defaults', 'not IE 11']
})
]
} |
I set externalSystemJS to true resolved this problem |
Can be reproduced by |
@patak-dev @bluwy Thanks for quick fix! But can you check if this fix will break the compatibility of es2015 unsupported browser. Since it skip the transform of polyfills chunk, it will left es2015 syntax to output |
Describe the bug
I try build my project with vite 3.
I use @vitejs/plugin-legacy for support old browsers.
my vite.config.js file is
I run script
yarn build
but i have a problemSystem Info
error during build: Error: Transform failed with 1 error: assets/polyfills-legacy.a7649e24.js:2104:3312: ERROR: Transforming const to the configured target environment ("es5" + 2 overrides) is not supported yet at failureErrorWithLog (/Users/aleksandreremeev/1bit/bitrix-vite-template/node_modules/esbuild/lib/main.js:1624:15) at /Users/aleksandreremeev/1bit/bitrix-vite-template/node_modules/esbuild/lib/main.js:1413:29 at /Users/aleksandreremeev/1bit/bitrix-vite-template/node_modules/esbuild/lib/main.js:678:9 at handleIncomingPacket (/Users/aleksandreremeev/1bit/bitrix-vite-template/node_modules/esbuild/lib/main.js:775:9) at Socket.readFromStdout (/Users/aleksandreremeev/1bit/bitrix-vite-template/node_modules/esbuild/lib/main.js:644:7) at Socket.emit (events.js:400:28) at addChunk (internal/streams/readable.js:293:12) at readableAddChunk (internal/streams/readable.js:267:9) at Socket.Readable.push (internal/streams/readable.js:206:10) at Pipe.onStreamRead (internal/stream_base_commons.js:188:23)
Used Package Manager
yarn
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: