question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

build --release is failing in webpack

See original GitHub issue
cordova build android

is successfuly building in platforms/android/build/outputs/apk/android-debug.apk

But when I want to build a release with

cordova build android --release

webpack build is failing with :

Before deploy hook started...
Checking is node modules installed...
Node modules already installed.
Starting webpack build...
Error happened when webpack build: Error: Command failed: /home/emak/code/portrait/node_modules/.bin/webpack --env.release
fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
clean-webpack-plugin: /home/emak/code/portrait/www has been removed.
(node:16644) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see https://github.com/webpack/loader-utils/is
sues/56                                                                                                                                                       parseQuery() will be replaced with getOptions() in the next major version of loader-utils.

Webpack build completed to www folder successfully!
Error happened on main chain:
Error: Error happened when webpack build: Error: Command failed: /home/emak/code/portrait/node_modules/.bin/webpack --env.release
fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
clean-webpack-plugin: /home/emak/code/portrait/www has been removed.
(node:16644) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see https://github.com/webpack/loader-utils/is
sues/56                                                                                                                                                       parseQuery() will be replaced with getOptions() in the next major version of loader-utils.

    at exec (/home/emak/code/portrait/hooks/hookers.js:171:19)
    at ChildProcess.exithandler (child_process.js:218:5)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:885:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
Error: Error happened when webpack build: Error: Command failed: /home/emak/code/portrait/node_modules/.bin/webpack --env.release
fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
clean-webpack-plugin: /home/emak/code/portrait/www has been removed.
(node:16644) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see https://github.com/webpack/loader-utils/is
sues/56                                                                                                                                                       parseQuery() will be replaced with getOptions() in the next major version of loader-utils.

I tried to change webpack.config.js:L77-78 according to this messages without success.

fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12

github_iconTop GitHub Comments

3reactions
Em-AKcommented, Mar 3, 2017

My current workaround is to launch

cordova prepare

then

cordova compile android --release

so that webpack compiles as usual without the release flag. The outputed JS may not be optimal but it runs.

2reactions
coedycodecommented, Mar 15, 2017

Hi @Em-AK I’ve been seeing similar error output when running a build release.

In my case I found running the webpack process on it’s own

./node_modules/.bin/webpack --env.release

gave a more verbose error report, and the problems turned out to be Uglifyjs finding syntax errors in my vue components (I’ve been using ES2105 and there’s no babel step in the release build, but the ES2015 is all supported by chrome so in development there were no problems. ).

The vue-loader will transpile if there’s .bablerc with { “presets”: [“es2015”] } in the root directory.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Build Failure while using webpack production build
As pointed out in a comment there has to be something with babel configuration that webpack can't transpile JSX syntax.
Read more >
build definition started to fail on typescript webpack operation
But my build failed. I have a prebuild step of running webpack, which compiles the typescript code and creates a set of packed...
Read more >
Command Line Interface
webpack -cli offers a variety of commands to make working with webpack easier. ... Output the version number of webpack , webpack-cli and...
Read more >
Jupyter lab build fails with webpack-cli error - extensions
I was trying to build jupyterlab (v3.3.4, Windows 10), but it failed. The log file gives the following error: $ webpack --config ...
Read more >
Next.js deploy fails on webpack build
This suggests to me that while the version number hasn't changed, something in the code has. It also appears some dependencies in your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found