Skip to content

Instantly share code, notes, and snippets.

@dakoctba
Last active April 7, 2017 09:54
Show Gist options
  • Save dakoctba/7377d540af76a4f88650b71fc38c7a01 to your computer and use it in GitHub Desktop.
Save dakoctba/7377d540af76a4f88650b71fc38c7a01 to your computer and use it in GitHub Desktop.
Module build failed: Error: (...) mozjpeg/vendor/cjpeg: Syntax error: ")" unexpected

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)
@berkin
Copy link

berkin commented Mar 25, 2017

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.

...
RUN npm install --no-bin-links
RUN npm un url-loader image-webpack-loader --save-dev

RUN apt-get install nasm
RUN npm i url-loader image-webpack-loader --save-dev
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment