Giter Club home page Giter Club logo

Comments (14)

sporto avatar sporto commented on July 30, 2024 2

As of version 4.5.0 of the webpack cli you cannot pass --watch anymore to the dev server.
ie. webpack serve --watch will throw an error.

Without --watch the loader doesn't recompile changes. So atm this loader seems to be incompatible with webpack-cli 4.5. Unless I'm missing some options that need to be passed somewhere else.

#198

from elm-webpack-loader.

IloSophiep avatar IloSophiep commented on July 30, 2024 1

I'm also having this problem. To add some info that seems to be the case for me:

  • The problem only happens when using npx webpack-dev-server - using npx webpack --watch seems to still work just fine?
  • It only affects the file not referenced in my webpack entry point javascript file. So changes in Main.elm do trigger a recompile, while changes in other files (not referenced in JS files) do not.

from elm-webpack-loader.

dccarmo avatar dccarmo commented on July 30, 2024 1

Having the same issue currently, any workarounds? I went back to 6.0.1 and everything is working fine.

from elm-webpack-loader.

DawidJanczak avatar DawidJanczak commented on July 30, 2024 1

This bug is still a thing, but it only occurs for files that are imported from other files. Entry points load just fine, that's why it's working in that example repo @simonh1000 - there's only one Elm file there. Adding --watch option to webpack does work, however it recompiles all the files instead of just the one that's been changed.

from elm-webpack-loader.

maxfarseer avatar maxfarseer commented on July 30, 2024

Agree here. I came to the same issue yesterday.
OS X, version 10.15.6 (19G2021)
p.s. also error message way more nicer in version 6.0.1
p.p.s. thx for your loader!

from elm-webpack-loader.

rlopzc avatar rlopzc commented on July 30, 2024

Same is happening for me. I was using forceWatch: true

from elm-webpack-loader.

jhillyerd avatar jhillyerd commented on July 30, 2024

Ran into the same issue today, adding --watch to my dev server script solved it:

    "dev": "webpack-dev-server --mode development --port 3000 --hot --watch",

However, my hot reload errors are still broken, instead of the elm compiler output, I just get this in the browser modal overlay:

Failed to compile.

./src/Main.elm
Module build failed (from ./node_modules/elm-webpack-loader/index.js):
Compiler process exited with error Compilation failed

Configs I'm using:

https://github.com/inbucket/inbucket/blob/cf4c5a29bb05bd029221c890ea5ff9842ba295cb/ui/package.json
https://github.com/inbucket/inbucket/blob/cf4c5a29bb05bd029221c890ea5ff9842ba295cb/ui/webpack.config.js

from elm-webpack-loader.

sporto avatar sporto commented on July 30, 2024

We upgraded to Webpack 5 and this works fine provided that you have --watch.
In version 6 of this plugin somehow the flag --watch was not necessary.

from elm-webpack-loader.

rdelgatte avatar rdelgatte commented on July 30, 2024

I had the same issue and adding the --watch flag to the webpack-dev-server command fixed the issue πŸ‘

from elm-webpack-loader.

simonh1000 avatar simonh1000 commented on July 30, 2024

But --watch gave me a webpack 5 deprecation warning.
That said, after remove. --watch, I seem to have everything working fine anyway - see simonh1000/elm-webpack-starter#35 for code

from elm-webpack-loader.

simonh1000 avatar simonh1000 commented on July 30, 2024

at the end of the day, this is a webpack bug, and it might have been fixed. This issue should probably be closed

from elm-webpack-loader.

ocharles avatar ocharles commented on July 30, 2024

I'd like to suggest we bring back forceWatch for a different reason - using this with Storybook. Storybook seems to run its own server which means compiler.watching is false. I'm not entirely sure if that can be fixed, but right now it means that I can't get proper dependency tracking in Storybook at all, which really sucks. Just having this flag and letting me set it in my Storybook Webpack config would unblock me.

from elm-webpack-loader.

wadouk avatar wadouk commented on July 30, 2024

Just for info, downgrading to webpack before 4.5 is incompatible with dev server see webpack/webpack-cli#2422

from elm-webpack-loader.

wadouk avatar wadouk commented on July 30, 2024

had to install live-server and run webpack --watch --mode=development

    "webpack": "4.44.1",
    "webpack-cli": "4.5.0"

from elm-webpack-loader.

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.