nuxt/loading-screen

I'm getting WS error in the browser (during & after) the building process

chanlito opened this issue · 9 comments

I get this error during building nuxt.

Also it persists after building.

Screen Shot 2019-04-13 at 3 05 35 PM

Also after build is done, if I reload the page it disappears.

pi0 commented

Hi. Are you using nuxt with custom server (express, etc) or using nuxt dev?

Hey @pi0 I'm using express. Here I made a repo https://github.com/chanlito/nuxt-loading-bug showing the issue.

pi0 commented

Unfortunately, this is expected as setting up WebSocket for a custom server requires additional code in the project. (Related issue #9) Loading-screen has a fallback with normal HTTP requests so progress should work for you.

Maybe it would be a better idea to hide [WS] errors.

I got the same issue, I don't see how hiding errors would fix it. What additional code would be needed?

pi0 commented

@LOUKOUKOU Are you using nuxt 2.9?

@pi0 "nuxt": "^2.4.0",

I think im using Nuxt.js v2.6.3

image

my server.js looks like this. I'm also using "@nuxt/loading-screen": "0.3.0"

pi0 commented

Please upgrade nuxt to 2.9. New version of loading-screen uses SSE which should resolve your issues.

So it doesn't throw the errors now, but it stays on the loading screen.
image
And then eventually throws an error
image

ohhhhhhhhhhhhhhhhhhhhh!
Make sure do this

let config = require('./nuxt.config.js')
config.dev = false

Otherwise it thinks your in dev, but didn't build anything, so it has nothing to load. I works now, thanks a bunch.