Giter Site home page Giter Site logo

Comments (4)

shellscape avatar shellscape commented on May 20, 2024

Thanks for the issue but this isn't a problem with koa-webpack. Rather, this is an issue with webpack-hot-client.

You should also resolve this error:

「hot」: WebSocket Server Error { Error: listen EADDRINUSE 127.0.0.1:8081

It's very relevant, actually. If you have another socket server running off of different/other settings, it's going to mess up the instance you're trying to run. I'd recommend passing a different port to the hot settings, or making sure you're closing the koa-webpack middleware instance. The assumption that a separate instance of koa-webpack, and subsequently webpack-hot-client, wouldn't try to start a new socket server is a poor one - that's a core function of the module, and essential when running multiple instances.

Looking at webpack-hot-client, we can see that the module does actually disable HMR: https://github.com/webpack-contrib/webpack-hot-client/blob/master/lib/client/index.js#L31 in the traditional sense, and instead reloads the page should an update be detected. That's the behavior that the hot option dictates. If you wanted to disable full page reload, you'd have to use the reload: false option, which currently appears to be ignored. However, if you don't want any refresh when an HMR patch is detected, then you should use webpack-dev-middleware directly, as 50% of koa-webpack's usefulness is then moot.

from koa-webpack.

heisian avatar heisian commented on May 20, 2024

Thanks for the reply. What I meant was that it seems the other server listening on 8081 must be an existing webpack-hot-clien websockets server that didnt get closed when I SIGINT’ed my previous run of the script.

At any rate you’re right, I should simply just use webpack-dev-middleware. Thank you for the advice and help.

from koa-webpack.

liubin915249126 avatar liubin915249126 commented on May 20, 2024

['dev'] is an invalid additional property? why?

from koa-webpack.

shellscape avatar shellscape commented on May 20, 2024

@liubin915249126 it's considered poor form to ask an off-topic question in an issue thread. Please do have a read about Github etiquette. Your question is what is called "thread jacking." Read the README, that's not a valid option.

from koa-webpack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.