If you received the following error:
ERROR in ./assets/big.jpg
Module build failed: Error: /home/vagrant/apps/webpack-tests/node_modules/mozjpeg/vendor/cjpeg: 1: /home/vagrant/apps/webpack-tests/node_modules/mozjpeg/vendor/cjpeg: Syntax error: ")" unexpected
at Promise.all.then.arr (/home/vagrant/apps/webpack-tests/node_modules/execa/index.js:201:11)
at process._tickCallback (internal/process/next_tick.js:103:7)
@ ./src/image_viewer.js 3:11-39
@ ./src/index.js
You can solve it like this:
- Remove the packages (
npm un url-loader image-webpack-loader --save-dev
) - Install nasm (
sudo apt-get install nasm
) - Reinstall the packages (
npm i url-loader image-webpack-loader --save-dev
)
Update
i found the problem. my node_modules dir was not added the dockerignore so it was copying my local generated node_modules folder.
i am using inside docker image, it is mysterious. my docker file is like below. if i move "install nasm" to top, it is now working.