question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hot Reload does not work. WebSocket frame shows up a type:invalid payload

See original GitHub issue

Version

3.3.0

Environment info

Environment Info:

  System:
    OS: Linux 4.9 Debian GNU/Linux 9 (stretch) 9 (stretch)
    CPU: (2) x64 Intel(R) Core(TM) i7-5650U CPU @ 2.20GHz
  Binaries:
    Node: 10.15.0 - /usr/local/bin/node
    Yarn: 1.12.3 - /usr/local/bin/yarn
    npm: 6.4.1 - /usr/local/bin/npm
  Browsers:
    Chrome: Not Found
    Firefox: Not Found
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

  1. Download the attached archive Bug.zip and extract it
  2. npm install
  3. ./node_modules/.bin/vue-cli-service serve
  4. Edit the file src/ui/boot-view.vue and see HMR failing

What is expected?

Changing a Vue component source code, modifications should be reflected on the client without the need of reloading the page.

What is actually happening?

Changes are processed by the vue-cli resulting in a valid build output, but they are not correctly notified to the client.


Hot Reloading was working fine with version 3.1 of vue-cli.

Looking inside the Chrome Network Panel these are the WebSocket frames:

o
a["{\"type\":\"hot\"}"]
a["{\"type\":\"overlay\",\"data\":{\"warnings\":false,\"errors\":true}}"]
a["{\"type\":\"log-level\",\"data\":\"none\"}"]
a["{\"type\":\"hash\",\"data\":\"4817374291a2ba483ed7\"}"]
a["{\"type\":\"ok\"}"]

At this point I change the source code and when the vue-cli ends compilation this is what is notified to the client:

a["{\"type\":\"invalid\"}"]
a["{\"type\":\"invalid\"}"]
a["{\"type\":\"hash\",\"data\":\"5b48de2c0f5894247e83\"}"]
a["{\"type\":\"ok\"}"]

It doesn’t matter what I change (style/js/template) in which component, I end up always with the same result. The only way to fix it is manually reloading the page.

package.json

        "@babel/core": "7.2.2",
        "@babel/plugin-proposal-export-default-from": "7.2.0",
        "@babel/plugin-proposal-nullish-coalescing-operator": "7.2.0",
        "@babel/plugin-proposal-object-rest-spread": "7.2.0",
        "@babel/plugin-proposal-optional-chaining": "7.2.0",
        "@babel/plugin-proposal-pipeline-operator": "7.2.0",
        "@babel/plugin-syntax-jsx": "7.2.0",
        "@babel/preset-env": "7.2.3",
        "@vue/babel-helper-vue-jsx-merge-props": "1.0.0-beta.2",
        "@vue/babel-preset-jsx": "1.0.0-beta.2",
        "@vue/cli": "3.3.0",
        "@vue/cli-plugin-babel": "3.3.0",
        "@vue/cli-service": "3.3.1",
        "babel-loader": "8.0.5",
        "babel-plugin-transform-imports": "1.5.1",
        "vue": "2.5.22",
        "vue-cli-plugin-quasar": "0.17.1",
        "vue-router": "3.0.2",
        "vue-template-compiler": "2.5.22",
        "webpack": "4.29.0",
        "webpack-cli": "3.2.1"

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:20 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mecampbellsoupcommented, Mar 2, 2021

Given the a["{\"type\":\"invalid\"}"] payload inside the WebSocket frame, is there anything I can do to output the cause of the error. I mean enabling some vue-cli/webpack debug options. At least for trying to understand who is emitting that invalid message and why.

Does anyone know the answer to this? I was thinking of using something like devServer.proxy or devServer.after to … check the response message content from the websocket server I suppose?

cc @daniele-orlando

1reaction
hsablonnierecommented, Jan 24, 2019

@jkzing During my investigations, I deleted my node_modules so maybe I just had to clear the cache. Thanks for the info.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Beast error The WebSocket frame payload was not valid utf8 ...
Client code where I am sending 2 serialized protobuf messages. The first message arrives, the second one crashes. #include <boost/beast/core.hpp> ...
Read more >
.NET 6 Hot Reload and "Refused to connect to ws: because it ...
Hm, self seems reasonable, why can't the browser connect BACK to the dotnet run'ed Kestrel Web Server? It's all localhost, right? Well, ...
Read more >
Supplemental Document: BIG-IP 17.0.0 Fixes and Known Issues
Gateway HTTP/2, response payload intermittently not forwarded to client. 16.1.2.2. 1073549, 3-Major, TMSH hardening. 1073357, 3-Major, TMM may crash while ...
Read more >
sgcWebSockets .NET 2022.10 - eSeGeCe
cross frame communication in an attempt to avoid page reloads followed by HTTP ... tations are no longer a problem since WebSockets represent...
Read more >
Cisco Finesse Web Services Developer Guide, Release 12.5(1)
If the Cisco Finesse Tomcat service is not running, ... BOSH/WebSocket is an open technology for real-time communication and is useful for ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found