pugjs / pug-loader

Pug loader module for Webpack
MIT License
425 stars 119 forks source link

DeprecationWarning: loaderUtils.parseQuery() received a non-string value #94

Open pttsky opened 7 years ago

pttsky commented 7 years ago

Hi! I have following in my webpack.config.js module.rules section:

{
  test: /\.pug/,
  loader: 'pug-loader',
  query: {
    debug: true
  }
}

When I run Webpack, I get:

(node:9500) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see https://github.com/webpack/loader-utils/issues/56
parseQuery() will be replaced with getOptions() in the next major version of loader-utils.```

For following config variants, there message stays still:

{
  test: /\.pug/,
  loader: 'pug-loader',
  options: {
    debug: true
  }
}

or

{
  test: /\.pug/,
  use: {
    loader: 'pug-loader',
    options: {
      debug: true
    }
  }
}

or

{
  test: /\.pug/,
  use: {
    loader: 'pug-loader',
   query: {
     debug: true
    }
  }
}

When remove 'query' option:

{
  test: /\.pug/,
  loader: 'pug-loader'
}

the issue is gone and console output is clear. I've read through the issue specified by link emitted into my console and there said that I should create issue for authors of the appropriate loader. Please help me and maybe fix that or if tell if I am wrong. I am using Webpack version 2.3.2. Thank you!

laggingreflex commented 7 years ago

It seems it's been fixed but npm package not updated? https://github.com/pugjs/pug-loader/pull/84

szimek commented 7 years ago

@TimothyGu Could you release a new version with the fix from #84? Thanks!