-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
Image config from server (not transpiled) being imported in client #34629
Comments
Hi, https://caniuse.com/?search=const https://nextjs.org/docs/basic-features/supported-browsers-features Do you have a reproduction that breaks in IE11 because of this? |
Hi @balazsorban44 , thanks for your feedback. According to https://caniuse.com/?search=const it seems that So it seems pretty odd that from a recent release (we have recently updated to 12.1.0) server code is being included in the client build as not transpiled. We have been using |
Thanks for the extra context. 👍 The imported server file exports a single object and is not used in any for loops, so it really should be safe: next.js/packages/next/server/image-config.ts Lines 52 to 63 in dc20805
I'm curious if you have an example. I think the industry is moving away from IE11 (which as mentioned isn't even an issue here), so it's less likely that this could introduce an issue in the future. If you target IE11 users specifically, you could let the CI check test for IE11 features, instead of ES5, as seemingly there is no 100% overlap In reality though, if something would break in IE11 and is reported as a bug in Next.js, we would obviously release a fix immediately, as we do intend to support IE11 currently, and even in the future, we will let it be an opt-in target. See our RFC: #33227 That said, I agree it does not hurt to do what you propose, so I'll leave this issue open as a potential improvement opportunity. We should likely move the file as you suggested from the |
As mentioned in the RFC #33227, "Next.js currently targets ES5 for JS output". This was somehow my initial presumption to create this kind of issue. For the moment we have turned our es-check CI step from an error to a warning and will manually check for validation errors. We also have a simple e2e test targeting IE11 to check minimal functionality by loading login page and login action. Does Next.js have e2e tests agains IE11? |
Hi, @balazsorban44 ! Recently I've been working on migration to Next 12 at my company. At first I'd like to follow up #33854 in to my project, so I installed
Yes, IE 11 emits "Invalid Character" error with the white screen. As @vitorhsb mentioned, this is because a server side code (
I hope this might help. Can I get any hint for fixing this (either at Next.js or my project)? If it's not that hard, maybe I might try to fix this for my good first issue 😅. And is there any other ways to overcome #33854 without using |
Good catch, let's fix this then! 🙂
I tried to reproduce it, but I could not. Here is a deployment using an image with Could you attach a reproduction?
That is an unrelated issue, so let's keep this one to the point, but no, you currently either have to upgrade to |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
The file
server/image-config
is being imported innext/dist/client/image.js
.This injects non transpiled content into the main chunk file which in turn makes the client build not safe for ES5 and not working in IE11.
Expected Behavior
Only transpiled to ES5 (IE11) content in client builds.
To Reproduce
Create a new project from scratch:
Run es-check against
.next
folder:npx es-check es5 '.next/static/**/*.js' -v
The following error appears:
The text was updated successfully, but these errors were encountered: