preactjs / preact-cli

😺 Your next Preact PWA starts in 30 seconds.
MIT License
4.68k stars 376 forks source link

after run build, the page is blank #554

Closed dsky1990 closed 6 years ago

dsky1990 commented 6 years ago

Do you want to request a feature or report a bug? after run build, the page is blank,no idea what happened What is the current behaviour? image

dsky1990 commented 6 years ago

image the firstElementChild is i is not defined

dsky1990 commented 6 years ago

image after this function, the page is blank

dsky1990 commented 6 years ago

@developit can you help me check it ? thanks

dsky1990 commented 6 years ago

image

matthewlynch commented 6 years ago

Hi @dsky1990,

Are there any errors in the browser console?

dsky1990 commented 6 years ago

no @matthewlynch , I track the code ,found here makes the page blank

image

dsky1990 commented 6 years ago

blank

dsky1990 commented 6 years ago

but when i run npm run serve, it works fine , what cause this problem?

dsky1990 commented 6 years ago

is the https problem?? the page must serve in https?

dsky1990 commented 6 years ago

@developit

developit commented 6 years ago

It's likely a browser extension interfering, please try in an Incognito window.

reznord commented 6 years ago

@dsky1990 It would be great if you can drop a link to the repo.

dsky1990 commented 6 years ago

@reznord http://13.125.234.168:8080/wsh/build/index.html ,help to see it

lukeed commented 6 years ago

@dsky1990 You do have an https error coming from the service worker refusing to register. I don't think this is causing the blank rendering, but you can preact build --no-sw to turn that off & look at the underlying problem.

dsky1990 commented 6 years ago

@lukeed preact build --no-sw is not a right command

developit commented 6 years ago

@dsky1990 you're importing preact/debug twice (preact-cli does this for you).

The reason the screen blanks is because you have no default route, and no route is matching the current URL:

screen shot 2018-05-22 at 10 28 20 am

Notice that there are no routes in your <Router> that would match the URL:

screen shot 2018-05-22 at 10 29 51 am

You can see that this is the case if you pause when the page first loads, and change the URL to "/":

screen shot 2018-05-22 at 10 31 40 am
dsky1990 commented 6 years ago

@developit thanks very much