Skip to content

DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic #113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
akatechis opened this issue Feb 24, 2017 · 3 comments · Fixed by #114
Assignees

Comments

@akatechis
Copy link

I'm submitting a bug report

Webpack version: 2.2.1

HTML-Loader version: 0.4.4

Please tell us about your environment:
Windows 10, running webpack in Git Bash terminal.

Current behavior:
Running webpack causes the following deprecation warning:

(node:20712) 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.
    at Object.parseQuery (C:\workspace\app\node_modules\loader-utils\index.js:78:3)
    at getLoaderConfig (C:\workspace\app\node_modules\html-loader\index.js:17:26)
    at Object.module.exports (C:\workspace\app\node_modules\html-loader\index.js:28:15)
    at LOADER_EXECUTION (C:\workspace\app\node_modules\loader-runner\lib\LoaderRunner.js:119:14)
    at runSyncOrAsync (C:\workspace\app\node_modules\loader-runner\lib\LoaderRunner.js:120:4)
    at iterateNormalLoaders (C:\workspace\app\node_modules\loader-runner\lib\LoaderRunner.js:229:2)
    at Array.<anonymous> (C:\workspace\app\node_modules\loader-runner\lib\LoaderRunner.js:202:4)
    at Storage.finished (C:\workspace\app\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:38:15)
    at C:\workspace\app\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:69:9
    at C:\workspace\app\node_modules\graceful-fs\graceful-fs.js:78:16
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:415:3)

Expected/desired behavior: I should not see the deprecation warning.

The relevant rule for html-loader is the following (I'm using this in a knockout app, which allows developers to use HTML comments for data-binding "virtual elements." I configure html-loader to leave those comments intact:

{
      test: /\.html$/,
      use: [{
        loader: "html-loader",
        options: {
          ignoreCustomFragments: [/<!--\s*\/?ko.*-->/] // ignore knockout comments used for bindings
        }
      }]
}
  • What is the motivation / use case for changing the behavior?
    The issue in the deprecation warning asks webpack users to file an issue with any loader that triggers this warning.

  • Browser: all

  • Language: My config file is written in ES6

@joshwiens
Copy link
Member

@akatechis - We have seen & fixed this in other loaders thus far. PR is in, I'll get it merged & published shortly.

@joshwiens
Copy link
Member

@akatechis - html-loader v0.4.5 has been published to npm

@beckyao
Copy link

beckyao commented Sep 6, 2017

vim webpack.config.js

write "process.traceDeprecation = true"

you will fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants