shepherdwind / css-hot-loader

This is a css hot loader, which support hot module replacement for an extracted css file.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Throwing odd Error

djforth opened this issue · comments

I can see what the issue is, but if I remove the css-hot-loader it loads fine. I've set up as usual and can't see any issues with my set up:

ERROR in ./stylesheets/application.scss

Module build failed: ModuleBuildError: Module build failed:

               ^
  Invalid CSS after "...  var cssReload": expected "{", was '= require("../../..'
  in /Users/adrianstainforth/sites/gll3/app/javascript/stylesheets/application.scss (line 4, column 21)
at runLoaders (/Users/adrianstainforth/sites/gll3/node_modules/webpack/lib/NormalModule.js:195:19)
at /Users/adrianstainforth/sites/gll3/node_modules/loader-runner/lib/LoaderRunner.js:364:11
at /Users/adrianstainforth/sites/gll3/node_modules/loader-runner/lib/LoaderRunner.js:230:18
at context.callback (/Users/adrianstainforth/sites/gll3/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
at Object.asyncSassJobQueue.push [as callback] (/Users/adrianstainforth/sites/gll3/node_modules/sass-loader/lib/loader.js:55:13)
at Object.<anonymous> (/Users/adrianstainforth/sites/gll3/node_modules/async/dist/async.js:2257:31)
at Object.callback (/Users/adrianstainforth/sites/gll3/node_modules/async/dist/async.js:958:16)
at options.error (/Users/adrianstainforth/sites/gll3/node_modules/node-sass/lib/index.js:294:32)

@ ./packs/application.js 1:0-41

Setup from webpack config:

if (ifDevelopment()) {
    return {
      test: /\.(scss|sass|css)(\.erb)?$/i,
      use: [
        {
          loader: 'css-hot-loader',
          options: {
            fileMap: '../css/{fileName}',
          },
        },
      ].concat(ExtractTextPlugin.extract(extract)),
    };
  }

Will close this, actually turned out to be a change int he webpacker gem that was causing issue