Giter Site home page Giter Site logo

Comments (6)

mattraykowski avatar mattraykowski commented on August 21, 2024 1

I ran into this problem as well. I realized that it wasn't only not reloading but it was also not recompiling. It took a little digging but it appears that you need to do this:

{ loader: 'elm-webpack-loader', options: { /* your normal options and then */ cwd: '/path/to/source' }

https://github.com/elm-community/elm-webpack-loader#cwd-default-null-recommended

Adding cwd: './' to my loader options fixed the problem.

from elm-hot-loader.

fluxxu avatar fluxxu commented on August 21, 2024

Hi,

I tried to reproduce this issue here:
https://github.com/fluxxu/elm-hot-loader-issue-29
But HMR works on my side...
Could you try to break it so I can debug the issue?

from elm-hot-loader.

joanllenas avatar joanllenas commented on August 21, 2024

Exact same problem.
I was using create-elm-app v0.4.0 but there have been a few releases lately that fix this issue.

from elm-hot-loader.

pixelprizm avatar pixelprizm commented on August 21, 2024

@mattraykowski Ah yeah you're right, it's actually not even recompiling. However the cwd option didn't seem to fix my issue; saving the child component still doesn't trigger recompile.

@joanllenas I was using create-elm-app v0.4.0 as well, so I'll try upgrading and remaking my boilerplate.

from elm-hot-loader.

pixelprizm avatar pixelprizm commented on August 21, 2024

@joanllenas that worked for me. I looked at the new config generated by create-elm-app v0.6.0 and copied some new things over.

It seems that the fix is to add forceWatch: true to the elm-webpack-loader options:

      {
        test: /\.elm$/,
        exclude: [ /elm-stuff/, /node_modules/, /MainCss\.elm/ ],
        use: [
          {
            loader: 'elm-hot-loader'
          },
          {
            loader: 'elm-webpack-loader',
            options: {
              verbose: true,
              warn: true,
              debug: true,
              pathToMake: paths.elmMake,
              forceWatch: true
            }
          }
        ]
      },

from elm-hot-loader.

pixelprizm avatar pixelprizm commented on August 21, 2024

Thanks for your help everyone!

from elm-hot-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.