-
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
deploying to Vercel causes conditional statements to evaluate incorrectly #16542
Comments
Could you please upgrade to |
Okay. Just did this, and the problem persists. |
I should add that this isn't really CSS related. It seems like the conditional statement is being applied to the wrong element somehow. The CSS was just to illustrate that. |
Thanks, we'll take a peek soon! |
My original example had a lot going on. I made a clean new repo and was able to build up to triggering the bug. It seems to be related to rendering pages that use Incremental Static Regeneration. I still can't identify why the conditional is being applied to the wrong element because it's a completely silent error (AFAIK even if the boolean was flipped the result I'm getting from Vercel would still be impossible). Interestingly, the only valid evaluations of the following code are: <div>
<div class="SHOW"></div>
</div> or <div>
<div class="NO_SHOW"></div>
<div class="SHOW"></div>
</div> However, the Vercel page is the following: which should be impossible. Hence, this probably has to be a problem in either how Vercel transpiles my code or how the browser interprets the transpiled code. Because I've tested a couple different browsers and found the same problem across all of them, it seems to me that Vercel's transpiler likely has a bug. |
Rewrote the bug report to reference this reproduction. |
Did some investigating:
So this is definitely a bug in Next.js, we'll fix it 🙏 |
Sounds good. Thank you for the quick response! |
This normalizes the `asPath` for `getServerSideProps` and `getStaticProps` pages to ensure it matches the value that would show on the client instead of a) the output pathname when revalidating or generating a fallback or b) the `_next/data` URL on client transition. Fixes: #16542
Hi, this should be fixed in |
Thanks a million! I'll confirm everything is fixed when I get home evening. |
This normalizes the `asPath` for `getServerSideProps` and `getStaticProps` pages to ensure it matches the value that would show on the client instead of a) the output pathname when revalidating or generating a fallback or b) the `_next/data` URL on client transition. Fixes: vercel#16542
Hey, i am using "next": "^10.0.7" Is there any way to resolve this? |
It's just that I am getting this issue in dev mode, and only if I am refreshing the page or either going to that page directly. |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Bug report
Describe the bug
When rendering a page using Incremental Static Regeneration a *conditional statement is erroneously applied to the wrong element.
*I'm referring to conditional rendering expressions of the following form:
To Reproduce
npm install
, and *npm run dev
*
npm run build && npm run start
yields the same problemExpected behavior
A single div with the class
SHOW
should be added to the DOM regardless of the environment.System information
The text was updated successfully, but these errors were encountered: