deploying to Vercel causes conditional statements to evaluate incorrectly
See original GitHub issueBug 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:
<div>
{true && <div />}
<div />
</div>
To Reproduce
- go to my repo, https://github.com/AHBruns/vercel-repro
- clone it,
npm install
, and *npm run dev
- inspect element
- you’ll see the following, which is correct:
<div>
<div class="SHOW"></div>
</div>
- deploy the repo to Vercel
- go to the deployed site
- inspect element
- you’ll see the following, which is incorrect:
<div>
<div class="NO_SHOW"></div>
</div>
*npm run build && npm run start
yields the same problem
Expected behavior
A single div with the class SHOW
should be added to the DOM regardless of the environment.
System information
- Version of Next.js: v9.5.2
- Version of Node.js: v14.3.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (5 by maintainers)
Top Results From Across the Web
How do I resolve a 'module not found' error? - Vercel
The 'module not found' error is a syntax error that appears when the static import statement cannot find the file at the declared...
Read more >I am getting errors when deploying to Vercel. Can anyone ...
Firstly I'd recommend that you try run: yarn build or npm run build locally, as you'll be able to catch a lot of...
Read more >Using GitHub actions and Vercel for end-to-end tests
If we now open up a PR, we'll see a new status that reports on the status of our E2E tests. Pointing the...
Read more >Use Next.js and Vercel to build a link-sharing app using ...
js framework, which makes it easy to develop and deploy highly-optimized full-stack applications based on React. One of the most useful features Vercel...
Read more >Hi all! Does anyone have problem... - Sanity.io community
Does anyone have problem on deoplloying on Vercel (Using Next. js as ... I have two test projects, and once deployed, they don't...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Did some investigating:
next.config.js
withtarget: 'experimental-serverless-trace'
next build
console.log
in_app
logged out/404
which is unexpectedSo this is definitely a bug in Next.js, we’ll fix it 🙏
Hi, this should be fixed in
v9.5.4-canary.16
of Next.js please upgrade and give it a try!