roman01la / webpack-closure-compiler

[DEPRECATED] Google Closure Compiler plugin for Webpack
MIT License
464 stars 25 forks source link

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

Open axetroy opened 7 years ago

axetroy commented 7 years ago

I config the plugin use example in webpack@2.2.1

build and throw an error

$ npm run build

> @axetroy/event-emitter.js@1.1.0 build C:\Users\axetroy\gpmx\github.com\axetroy\event-emitter.js
> webpack --display-error-details --progress --colors

 10% building modules 1/1 modules 0 active(node:4544) 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.                                                    91% additional asset processingevents.js:                                                    160
      throw er; // Unhandled 'error' event
      ^

Error: write EPIPE
    at exports._errnoException (util.js:1022:11)
    at Socket._writeGeneric (net.js:712:26)
    at Socket._write (net.js:731:8)
    at doWrite (_stream_writable.js:334:12)
    at writeOrBuffer (_stream_writable.js:320:5)
    at Socket.Writable.write (_stream_writable.js:247:11)
    at Socket.write (net.js:658:40)
    at Socket.Writable.end (_stream_writable.js:480:10)
    at Socket.end (net.js:428:31)
    at Object.exports.compile (C:\Users\axetroy\gpmx\github.com\axetroy\event-emitter.js\node_modules\webpack-closure-compiler\lib\runner.js:72:25)
    at C:\Users\axetroy\gpmx\github.com\axetroy\event-emitter.js\node_modules\webpack-closure-compiler\index.js:70:9
    at C:\Users\axetroy\gpmx\github.com\axetroy\event-emitter.js\node_modules\async\lib\async.js:987:13
    at Immediate.process (C:\Users\axetroy\gpmx\github.com\axetroy\event-emitter.js\node_modules\async\lib\async.js:953:21)
    at runCallback (timers.js:651:20)
    at tryOnImmediate (timers.js:624:5)
    at processImmediate [as _immediateCallback] (timers.js:596:5)

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
npm ERR! node v6.10.0
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! @axetroy/event-emitter.js@1.1.0 build: `webpack --display-error-details --progress --colors`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @axetroy/event-emitter.js@1.1.0 build script 'webpack --display-error-details --progress --colors'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the @axetroy/event-emitter.js package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     webpack --display-error-details --progress --colors
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs @axetroy/event-emitter.js
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls @axetroy/event-emitter.js
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\axetroy\gpmx\github.com\axetroy\event-emitter.js\npm-debug.log
roman01la commented 7 years ago

@axetroy Not sure if this issue is related to the plugin, please make sure your Webpack config is valid. If everything is ok on your side, a minimal repro example would be nice to have so I can reproduce the issue.

axetroy commented 7 years ago

@roman01la I am pretty sure the Webpack config is valid.

only load this plugin and Babel. Babel work as expect. once load plugin, it throw this error.

it this plugin not compatible with Webpack2?

roman01la commented 7 years ago

@axetroy It is compatible. I need a minimal project to reproduce the issue, so I can help you.

axetroy commented 7 years ago

@roman01la thanks, I'm organizing the project response you soon

axetroy commented 7 years ago

@roman01la

I create a mini project in here https://github.com/axetroy/webpack-closure-compiler-example

run the command

git clone https://github.com/axetroy/webpack-closure-compiler-example.git
yarn    # npm install
yarn run build    # npm run build
roman01la commented 7 years ago

@axetroy thanks, I'll try this later today and get back to you

mhdatie commented 7 years ago

I'm receiving the same exact issue on Windows. I have an npm script with a MINIFY flag that is set to true in production and adds this plugin to the webpack. The development build works fine and setting the MINIFY flag to false in production also works.

roman01la commented 7 years ago

@axetroy I was about to test the project but the repo appears to be deleted. Could you please bring it back? Sorry for delay.

csentis commented 7 years ago

@roman01la recommend looking up this webpack loader-utils issue and setting process.traceDeprecation = true in (one of) your webpack config files. The line goes somewhere in the header, outside the webpack config object. If it is really your plugin then it will report accordingly.

bansawbanchee commented 6 years ago

This is actually not an issue with this plugin. ADVANCED compilation with Google Closure Compiler requires you to use externs when referencing external JavaScript. E.g window or any third party node_modules, such as the one listed in above output (https://github.com/axetroy/event-emitter.js) that you are including. I recommend taking a look at the docs for ADVANCED compilation located here: https://developers.google.com/closure/compiler/docs/api-tutorial3

roman01la commented 6 years ago

Does anyone still experience the issue?