responsively-app icon indicating copy to clipboard operation
responsively-app copied to clipboard

Blank screen on NextJS

Open vibeart opened this issue 2 years ago • 31 comments

🐞 bug report

✍️ Description

Hello! i get a blank screen when i use nextjs in development environment (npm run dev). In production mode (npm run start), the application runs normally. Looking at the source code, I could see that it is generated normally and that the page's favicon is also loaded. In other browsers, the application loads normally. I tested it with a Vite application, and it worked normally. Only with NExtJS does the white screen appear when I'm in dev mode (npm run dev)

🕵🏼‍♂️ Is this a regression?

it is the my first time with Resposively app

🔬 Minimal Reproduction

Just make a fresh install of NextJS using npx create-next-app@latest and run it with npm run dev

🌍 Your Environment


Version: 0.19.0
Electron: 9.3.1
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.22000
WSL2

🔥 Exception or Error or Screenshot


image

vibeart avatar Aug 03 '22 17:08 vibeart

Hey @vibeart :wave:,

Thank you for opening an issue. We will get back to you as soon as we can. Have you seen our Open Collective page? Please consider contributing financially to our project. This will help us involve more contributors and get to issues like yours faster.

https://opencollective.com/responsively

We offer priority support for all financial contributors. Don't forget to add priority label once you become one! :smile:

I am also having the same issue.

🌍 Your Environment


Version: 0.19.0
Electron: 9.3.1
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.22000
WSL2

My Development Server Environment:

  • create-nuxt-app v4.0.0
  • next v12.2.4

bryandonmarc avatar Aug 12 '22 11:08 bryandonmarc

I have the same issue, for now I solved it by using my local IP address instead of localhost.

Ex. http://192.168.0.100:3000 instead of http://localhost:3000

TheBinaryGuy avatar Sep 02 '22 08:09 TheBinaryGuy

I am having the same issue as well, just a blank page, with no visible errors in the console :(

waldothedeveloper avatar Sep 11 '22 16:09 waldothedeveloper

Facing the same issue.

Btw, thanks @TheBinaryGuy for the temporary solution. 🎉

mimukit avatar Sep 26 '22 19:09 mimukit

I have the same issue, for now I solved it by using my local IP address instead of localhost.

Ex. http://192.168.0.100:3000 instead of http://localhost:3000

I have the same original issue but, i couldn't fix it with the local ip.

I work on Windows 10, n I tried with all ipV4 address that provides my adapters, but any could connect.

My adapaters are:

  • Ethernet adapter vEthernet (WSL)
  • Wireless LAN adapter Local Area Connection* 11
  • Wireless LAN adapter Wi-Fi

I tried with "http://192.0.0.0" or "http://192.0.0.0:3000" and in both ways, didn't work. (directions as examples not real)

Any other idea ?

Mussakova avatar Sep 28 '22 14:09 Mussakova

@Mussakova Try setting up an alias in your hosts file. That might work.

TheBinaryGuy avatar Oct 01 '22 11:10 TheBinaryGuy

I'd like to pickup this issue and contribute a PR. I could not find a CONTRIBUTING doc for your repository. I did find the PR template. Do you have a Discord or chat channel where contributors discuss issues. I have questions about the architecture.

bernardm avatar Oct 13 '22 23:10 bernardm

Actually just 0.0.0.0:PORT are enough. No need to get the local ip. Default port http://0.0.0.0:3000

dougg0k avatar Nov 10 '22 19:11 dougg0k

I have the same issue, for now, I solved it using my local IP address instead of localhost.

Ex. http://192.168.0.100:3000 instead of http://localhost:3000

This works for me on Mac Os Ventura!

waldothedeveloper avatar Nov 10 '22 19:11 waldothedeveloper

I have the same issue, for now I solved it by using my local IP address instead of localhost.

Ex. http://192.168.0.100:3000 instead of http://localhost:3000

I'm facing the same issue, but for now it worked.

Thanks @TheBinaryGuy

MozerBuce avatar Nov 18 '22 07:11 MozerBuce

my next js app went blank nothing is visible ,backend is working properly but the index page is not showing anything Screenshot (39)

Aakib-Khan avatar Jan 02 '23 05:01 Aakib-Khan

Actually just 0.0.0.0:PORT are enough. No need to get the local ip. Default port http://0.0.0.0:3000

tried this, it still gave me black screen no visible error codes

GBG7 avatar Jan 09 '23 04:01 GBG7

check if you are importing css files in root that may cause the issue try commenting them and check

ahmedyounes avatar Jan 12 '23 04:01 ahmedyounes

@ahmedyounes what does that mean, importing css files in root? I found when using Chrome and looking at Elements all the html elements were there but the first line in head was:

If I removed that line in developer tools the page appeared, albeit with poor formatting. I don't know what the line does but body{display:none} certainly fits what's happening. The proposed solutions of using an ip number, even 0.0.0.0 still loaded the DOM showing all the html but nothing actually visible on the page.

isrd1 avatar Jan 18 '23 00:01 isrd1

In my case it was caused by FOUC as @isrd1 suggested.

We use styled-components so styles are injected in head and there is no need for FOUC. So workaround we currently use is set

body {
   ...
   display: none;
}

in global styles.

EDIT: In third party libraries FOUC will happen. In our case we render skeletons instead of them, until data is fetched

jchatrny avatar Jan 27 '23 14:01 jchatrny

I'm having the opposite happen to me. My development environment works fine, but when I do npm run build && npm run start, I just get a blank page with an error that says a client side exception has occurred. I've tried all of the suggestions within this thread, and those haven't worked either. The repository is public if anyone wants to look at it, just look for portfolio-website-v1

thereal-cc avatar Feb 16 '23 15:02 thereal-cc

I am having the same issue with the white black screen but using the local IP does not work for me as well

talhaa99 avatar Feb 21 '23 08:02 talhaa99

I am having the same issue with the white black screen but using the local IP does not work for me as well

Did you find any solution. Running into the same issue. No error in the console but still not able to load image in browser.

xr-dev-saurabh avatar Feb 22 '23 15:02 xr-dev-saurabh

in my case after many hours of trying every methods believe me , every methods

it was my google chrome version i updated and its work fine

Shahindavoodicom avatar Feb 28 '23 10:02 Shahindavoodicom

I'm facing the same issue and none of the tricks here worked

0tii avatar Apr 06 '23 19:04 0tii

I'm facing the same issue and none of the tricks here worked

try to update google chrome , node.js , or use another version of next.js

Shahindavoodicom avatar Apr 10 '23 07:04 Shahindavoodicom

I had a similar thing with a white screen appearing and 404 console log errors (in dev not build) while following along https://nextjs.org/learn/basics/create-nextjs-app/setup. Realised I had a speacial character in the folder that my code projects were in. I renamed it from '10% day' to 'ten-percent-day' and that fixed my issue.

Isabella-Mitchell avatar Jun 09 '23 15:06 Isabella-Mitchell

For whatever reasons the only browser that works for me is Microsoft Edge 🤷

dr-nyt avatar Jun 22 '23 09:06 dr-nyt

Having a same issue here. Version is "next": "14.0.1" Browser is Opera.

In my case, this white screen seems to only appear in the very first time when I run npm run dev for the first time after my PC and vscode startup. After I refresh the page it appeares to be fine but happens again after another startup.

Antenna00 avatar Nov 15 '23 10:11 Antenna00

Hi there. I have the same issue. I've tried all suggestion but none of those work. It's very annoying since it's for a client. And I've already did 97% of the work. Please help

ulrich00132 avatar Mar 03 '24 17:03 ulrich00132

@ulrich00132 try using the public domain to load resources for the page instead of the Vercel domain. Check to see if you have a bunch of js files that are not loading in your network tab, which are using Vercel deployed domain, if so, this might work for you.

HaileQ avatar Mar 03 '24 19:03 HaileQ