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

Created on 21 Feb 2017  ·  19Comments  ·  Source: vuejs/vue-loader

Hi all! I made a new webpack-simple project, and when running npm run build I get presented with the message in the title. Specifically:

404s will fallback to /index.html
webpack: wait until bundle finished: /dist/build.js
(node:568) 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.

This is visible when using performance: { hints: "warning" } in your webpack config.

Additionally, doing an npm run dev I get this warning text:

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (250 kB).
This can impact web performance.
Assets: 
  build.js (1.55 MB)

WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (250 kB). This can impact web performance.
Entrypoints:
  main (1.55 MB)
      build.js


WARNING in webpack performance recommendations: 
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/

What can be done about any of this two things? This is coming from a plain new vue init webpack-simple $myproject build, not something particularly involved and I'm not sure it is intentional

improvement

Most helpful comment

set process.noDeprecation = true , the warning will be removed

All 19 comments

same problem here

same problem here

How can i fix it?

set process.noDeprecation = true , the warning will be removed

@kazupon The warning seems to reappear at the line:
https://github.com/vuejs/vue-loader/blame/master/lib/loader.js#L435

where is the webpack config? how to set process.noDeprecation = true?

@rainjay where? use vue-cli,can't find any file named"webpack.config.js", "webpack.base.conf.js"? how to add it?

you need update:dev-server .js
var config = require('../config')
if (!process.env.NODE_ENV) {
process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV)
!!!! process.noDeprecation = true
}

how to fix?

Agree. Does process.noDeprecation = true go inside the webpack.config file?

Getting this error with npm run production on laravel-mix. Previously everything was fine. Compiled assets file is missing x2 "/" characters to comment out Vue.js and Sizzle.js about code. Including the characters to comment out the file does not allow code to be pushed into production.

Might be worth noting that npm run dev compiles fine

@connor11528 process.noDeprecation = true goes anwhere inside the webpack.config.js file. process is a global variable it seems.

Don't do this though. This just suppresses deprecation warnings but doesn't actually fix anything. Webpack should still load properly

Is this fixed to #671?
I still have parseQuery() to use
vuejs/vue-loader/loader.js#L440

update: dev-server.js
var config = require('../config')
if (!process.env.NODE_ENV) {
process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV)
process.noDeprecation = true
}

+1 for @ohute-couture... I wish this was properly addressed on vue-loader's side instead of everyone suppressing warnings in their Webpack configs :/

Why was this issue closed? I'm seeing this on 14.2.2 and it seems to be a valid issue.

@jmduke I'm guessing since there was a potential fix by @yyx990803 with the pr https://github.com/vuejs/vue-loader/commit/1d63e9ec610490767b447cee5cf53e00faf905fa.

你需要更新:dev-server .js
var config = require('../ config')
if(!process.env.NODE_ENV){
process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV)
! !process.noDeprecation = true
}

2.0中这个文件没有了 请问这个该怎么修改?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yozman picture yozman  ·  4Comments

chrisvfritz picture chrisvfritz  ·  4Comments

lijialiang picture lijialiang  ·  3Comments

sdvcrx picture sdvcrx  ·  3Comments

snoopdouglas picture snoopdouglas  ·  3Comments