Sapper: Getting Script Error when I refresh

Created on 7 Nov 2019  路  6Comments  路  Source: sveltejs/sapper

Can't seem to get to the bottom of this issue or even find a way to get an idea what is causing the error.

Here is the error message that I am receiving

Navigated to http://localhost:3000/
VM255 sapper-dev-client.89e34bae.js:21 [SAPPER] dev client connected
VM255 sapper-dev-client.89e34bae.js:25 Event聽{isTrusted: true, type: "error", target: EventSource, currentTarget: EventSource, eventPhase: 2,聽鈥
source.onerror @ VM255 sapper-dev-client.89e34bae.js:25

Most helpful comment

It's probably the livereload websocket being interrupted. You may ignore it. It's only present in dev.

Try this:

  1. open a new tab
  2. open devtools
  3. open http://localhost:3000/ in the tab that was just opened

Notice there is no error.

All 6 comments

The same, it is present at lest for a week.

I have tried the fresh install to verify and it is present there as well.

It's probably the livereload websocket being interrupted. You may ignore it. It's only present in dev.

Try this:

  1. open a new tab
  2. open devtools
  3. open http://localhost:3000/ in the tab that was just opened

Notice there is no error.

This should no longer be happening in 0.27.14.

@Conduitry bumping sapper version to 0.27.15 fixed it for me. Thanks!

This should no longer be happening in 0.27.14.

Hello!! I am having this problem when I run my project with sapper 0.27.16 through a docker container.

sapper-dev-client.js:25 Event聽{isTrusted: true, type: "error", target: EventSource, currentTarget: EventSource, eventPhase: 2,聽鈥
source.onerror @ sapper-dev-client.js:25
error (async)
connect @ sapper-dev-client.js:24
(anonymous) @ manifest-client.mjs:90
Promise.then (async)
(anonymous) @ manifest-client.mjs:89
:10000/__sapper__:1 GET http://localhost:10000/__sapper__ net::ERR_CONNECTION_REFUSED

At the moment it does not interfere with development, but I do not think it is the most successful and I do not get the correct way to solve it

I had this issue today on version 0.27.16 and I found it out to be an issue with my run scripts in package.json.

Here was what I had:

"scripts": {
    ...,
    "dev": "run-p watch:tailwind && sapper dev",
    ...
}

_Note_: run-p is from npm-run-all package.

This is a wrong config for npm-run-all and I updated it to be as following:

"scripts": {
    ...,
    "sapper:dev": "sapper dev",
    "dev": "run-p watch:tailwind sapper:dev",
    ...
}

This change resolved my issue. If you are still seeing the same issue, it's worth a quick check.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Rich-Harris picture Rich-Harris  路  3Comments

nikku picture nikku  路  4Comments

keyvan-m-sadeghi picture keyvan-m-sadeghi  路  4Comments

SARFEX picture SARFEX  路  3Comments

nolanlawson picture nolanlawson  路  4Comments