Skip to content
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

Webpack 4 support : DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic #3

Open
joyfulelement opened this issue Apr 27, 2018 · 0 comments

Comments

@joyfulelement
Copy link

Do you want to request a feature or report a bug? Bug

What is the current behavior?

When upgrading to webpack 4 and with the node tracing turned on (process.traceDeprecation = true; in webpack.config.js), by running the webpack-dev-server --mode development, the following DeprecationWarning with stack trace is shown.

(node:32184) 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:\app\node_modules\replace-loader\node_modules\loader-utils\index.js:78:3)
    at Object.module.exports (C:\app\node_modules\replace-loader\index.js:7:27)
    at LOADER_EXECUTION (C:\app\node_modules\loader-runner\lib\LoaderRunner.js:119:14)
    at runSyncOrAsync (C:\app\node_modules\loader-runner\lib\LoaderRunner.js:120:4)
    at iterateNormalLoaders (C:\app\node_modules\loader-runner\lib\LoaderRunner.js:229:2)
    at iterateNormalLoaders (C:\app\node_modules\loader-runner\lib\LoaderRunner.js:218:10)
    at C:\app\node_modules\loader-runner\lib\LoaderRunner.js:233:3
    at Object.context.callback (C:\app\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
    at Object.module.exports (C:\app\node_modules\eslint-loader\index.js:225:11)
    at LOADER_EXECUTION (C:\app\node_modules\loader-runner\lib\LoaderRunner.js:119:14)

What is the expected behaviour?

I believe this is due to the loaderUtils.parseQuery() call:

var query = loaderUtils.parseQuery(this.query);
which can be replaced by loaderUtils.getOptions() as indicated on webpack/loader-utils#56 (comment) help remove the Deprecation Warning.

Dependencies/Tool Lineup

"replace-loader": "0.2.0",
"webpack": "4.6.0",
"webpack-cli": "2.0.15",
"webpack-dev-server": "3.1.3",
Node v8.9.1
Windows 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant