Error while building
oxneat opened this issue · 2 comments
everyThing seems ok while in developement but it crashes while building
---- using yarn
$ yarn build
yarn run v1.22.10
$ cross-env NODE_ENV=production webpack --config webpack.build.config.js --mode production
Hash: 644fc682e3e5f616b91a
Version: webpack 4.44.1
Time: 38070ms
Built at: 2020-10-09 18:15:06
6 assets
Entrypoint main = bundle.css main.js
ERROR in unknown: Unexpected token (149831:13)
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
-------using npm
$npm run build
electron-react-webpack-boilerplate@1.12.2 build C:\Users\DESKTOP\Desktop\Applications\electronWebpack-main
cross-env NODE_ENV=production webpack --config webpack.build.config.js --mode production
Hash: 644fc682e3e5f616b91a
Version: webpack 4.44.1
Time: 47047ms
Built at: 2020-10-09 18:27:22
6 assets
Entrypoint main = bundle.css main.js
ERROR in unknown: Unexpected token (149831:13)
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! electron-react-webpack-boilerplate@1.12.2 build: cross-env NODE_ENV=production webpack --config webpack.build.config.js --mode production
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the electron-react-webpack-boilerplate@1.12.2 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\DESKTOP\AppData\Roaming\npm-cache_logs\2020-10-09T16_27_26_377Z-debug.log
I tried to building the app with fresh install and it worked without any problem. Try to remove node_modules
folder and yarn.lock
file and reinstall dependencies. Then, try to run build script again.
yarn run v1.22.5
$ cross-env NODE_ENV=production webpack --config webpack.build.config.js --mode production
Browserslist: caniuse-lite is outdated. Please run the following command: `yarn upgrade`
Hash: 8347e548dbb8ae48c3af
Version: webpack 4.44.1
Time: 9775ms
Built at: 11. 10. 2020 13:38:38
Asset Size Chunks Chunk Names
bundle.css 478 bytes 0 [emitted] main
index.html 241 bytes [emitted]
main.js 128 KiB 0 [emitted] main
Entrypoint main = bundle.css main.js
Done in 12.27s.
yeah thanks bro it worked