Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

./public/images/avatar.jpg TypeError: Failed to parse URL from /node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_node_dec.wasm #1260

Closed
Cyclic opened this issue Jul 11, 2022 · 6 comments

Comments

@Cyclic
Copy link

Cyclic commented Jul 11, 2022

Describe the bug
Error running yarn build.

TypeError: Failed to parse URL from```

**To Reproduce**
Steps to reproduce the behavior:
1. run `yarn install; yarn build;`
2. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Version:**
 - OS w/ version: `Mac OS 12.4 Beta 3`
 - Browser w/ version: `Safari Version 16.0 (18614.1.19.1.5)`
 - Node version: `v18.5.0`
 - npm version: `8.12.1`
 - yarn version: `1.22.19`
 - nextjs version: `12.2`


Please attach original and output images (you can drag & drop to attach). 
-  ![default-long-list](https://user-images.githubusercontent.com/553800/178351606-78240644-f2ca-49f9-be84-240d31ca856d.jpg)
-  Output image from Squoosh (fails)

**Additional context, screenshots, screencasts**
- Deleted and recloned the repo. Deleted node_modules folder. Removed and reinstall node, npm, and yarn.

info - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/eslint#disabling-rules
info - Disabled SWC as replacement for Babel because of custom Babel configuration ".babelrc" https://nextjs.org/docs/messages/swc-disabled
info - Creating an optimized production build
Failed to compile.

./public/images/avatar.jpg
TypeError: Failed to parse URL from /Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_node_dec.wasm
at new Request (node:internal/deps/undici/undici:4832:19)
at Agent.fetch2 (node:internal/deps/undici/undici:5524:29)
at Object.fetch (node:internal/deps/undici/undici:6351:20)
at fetch (node:internal/bootstrap/pre_execution:197:25)
at instantiateAsync (/Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_node_dec.js:424:28)
at createWasm (/Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_node_dec.js:447:13)
at /Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_node_dec.js:1480:19
at Object.instantiateEmscriptenWasm (/Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/emscripten-utils.js:15:12)
at Object.dec (/Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/codecs.js:156:42)
at Object.decodeBuffer (/Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/impl.js:55:31)

Import trace for requested module:
./pages/index.tsx

./public/images/avatar03.jpg
TypeError: Failed to parse URL from /Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_node_dec.wasm
at new Request (node:internal/deps/undici/undici:4832:19)
at Agent.fetch2 (node:internal/deps/undici/undici:5524:29)
at Object.fetch (node:internal/deps/undici/undici:6351:20)
at fetch (node:internal/bootstrap/pre_execution:197:25)
at instantiateAsync (/Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_node_dec.js:424:28)
at createWasm (/Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_node_dec.js:447:13)
at /Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_node_dec.js:1480:19
at Object.instantiateEmscriptenWasm (/Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/emscripten-utils.js:15:12)
at Object.dec (/Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/codecs.js:156:42)
at Object.decodeBuffer (/Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/impl.js:55:31)

Import trace for requested module:
./pages/my-nft-wallets-history/index.tsx

./public/images/collection-bg.jpg
TypeError: Failed to parse URL from /Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_node_dec.wasm
at new Request (node:internal/deps/undici/undici:4832:19)
at Agent.fetch2 (node:internal/deps/undici/undici:5524:29)
at Object.fetch (node:internal/deps/undici/undici:6351:20)
at fetch (node:internal/bootstrap/pre_execution:197:25)
at instantiateAsync (/Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_node_dec.js:424:28)
at createWasm (/Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_node_dec.js:447:13)
at /Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_node_dec.js:1480:19
at Object.instantiateEmscriptenWasm (/Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/emscripten-utils.js:15:12)
at Object.dec (/Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/codecs.js:156:42)
at Object.decodeBuffer (/Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/impl.js:55:31)

Import trace for requested module:
./src/components/listing-detail-view/buyer.tsx
./src/components/listing-detail-view/index.ts
./pages/listing-detail-view/[type].tsx

./public/images/default-long-list.jpg
TypeError: Failed to parse URL from /Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_node_dec.wasm
at new Request (node:internal/deps/undici/undici:4832:19)
at Agent.fetch2 (node:internal/deps/undici/undici:5524:29)
at Object.fetch (node:internal/deps/undici/undici:6351:20)
at fetch (node:internal/bootstrap/pre_execution:197:25)
at instantiateAsync (/Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_node_dec.js:424:28)
at createWasm (/Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_node_dec.js:447:13)
at /Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_node_dec.js:1480:19
at Object.instantiateEmscriptenWasm (/Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/emscripten-utils.js:15:12)
at Object.dec (/Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/codecs.js:156:42)
at Object.decodeBuffer (/Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/impl.js:55:31)

Import trace for requested module:
./src/layouts/onboarding/onboarding.component.tsx
./pages/account-created/index.tsx

./public/images/gallery-background-1.jpg
TypeError: Failed to parse URL from /Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_node_dec.wasm
at new Request (node:internal/deps/undici/undici:4832:19)
at Agent.fetch2 (node:internal/deps/undici/undici:5524:29)
at Object.fetch (node:internal/deps/undici/undici:6351:20)
at fetch (node:internal/bootstrap/pre_execution:197:25)
at instantiateAsync (/Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_node_dec.js:424:28)
at createWasm (/Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_node_dec.js:447:13)
at /Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/mozjpeg/mozjpeg_node_dec.js:1480:19
at Object.instantiateEmscriptenWasm (/Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/emscripten-utils.js:15:12)
at Object.dec (/Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/codecs.js:156:42)
at Object.decodeBuffer (/Volumes/data/code/neutrinos/node_modules/next/dist/server/lib/squoosh/impl.js:55:31)

Import trace for requested module:
./pages/index.tsx

Build failed because of webpack errors
error Command failed with exit code 1.

@Cyclic
Copy link
Author

Cyclic commented Jul 11, 2022

Oddly, I came back to my computer after stepping away, and VS code had this output at terminal:
ol modedecodeCorrupt JPEG data: bad Huffman codeBogus input colorspaceBogus JPEG colorspacevoidBacking store not supportedIDCT output block size %d not supportedSorry, arithmetic coding is not implementedQuantization table 0x%02x was not definedHuffman table 0x%02x was not definedWrite to XMS failedRead from XMS failedWrite to EMS failedRead from EMS failed %3d %3d %3d %3d %3d %3d %3d %3dWarning: unknown JFIF revision number %d.%02dCorrupt JPEG data: found marker 0x%02x instead of RST%dStart Of Frame 0x%02x: width=%u, height=%u, components=%d Component %d: %dhx%dv q=%dInvalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d Ss=%d, Se=%d, Ah=%d, Al=%d Component %d: dc=%d ac=%dInvalid progressive parameters at scan script entry %dInvalid scan script at entry %dBogus DQT index %dBogus DHT index %dBogus DAC index %dToo many color components: %d, max %dInconsistent progression sequence for component %d coefficient %dWrong JPEG library version: library is %d, caller expects %dAt marker 0x%02x, recovery action %dUnsupported JPEG data precision %dDefine Quantization Table %d precision %dAdobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %dImproper call to JPEG library in state %dCannot transcode due to multiple use of quantization table %dUnknown Adobe color transform code %dInvalid memory pool code %dBogus message code %dJFIF APP0 marker: version %d.%02d, density %dx

@donmccurdy
Copy link

@message
Copy link

message commented Sep 20, 2022

Same issue with Node v18.8.0

./src/images/pages/500/background.webp
TypeError: Failed to parse URL from /home/message/www/myproject/node_modules/next/dist/server/lib/squoosh/webp/webp_node_dec.wasm
    at new Request (node:internal/deps/undici/undici:5491:19)
    at Agent.fetch2 (node:internal/deps/undici/undici:6288:25)
    at Object.fetch (node:internal/deps/undici/undici:7125:20)
    at fetch (node:internal/process/pre_execution:214:25)
    at instantiateAsync (/home/message/www/myproject/node_modules/next/dist/server/lib/squoosh/webp/webp_node_dec.js:404:28)
    at createWasm (/home/message/www/myproject/node_modules/next/dist/server/lib/squoosh/webp/webp_node_dec.js:427:13)
    at /home/message/www/myproject/node_modules/next/dist/server/lib/squoosh/webp/webp_node_dec.js:1349:19
    at Object.instantiateEmscriptenWasm (/home/message/www/myproject/node_modules/next/dist/server/lib/squoosh/emscripten-utils.js:15:12)
    at Object.dec (/home/message/www/myproject/node_modules/next/dist/server/lib/squoosh/codecs.js:190:42)
    at Object.decodeBuffer (/home/message/www/myproject/node_modules/next/dist/server/lib/squoosh/impl.js:55:31)

Import trace for requested module:
./src/components/errors/SomethingWentWrong.tsx
./src/pages/_error.tsx

./src/images/pages/503/background.webp
TypeError: Failed to parse URL from /home/message/www/myproject/node_modules/next/dist/server/lib/squoosh/webp/webp_node_dec.wasm
    at new Request (node:internal/deps/undici/undici:5491:19)
    at Agent.fetch2 (node:internal/deps/undici/undici:6288:25)
    at Object.fetch (node:internal/deps/undici/undici:7125:20)
    at fetch (node:internal/process/pre_execution:214:25)
    at instantiateAsync (/home/message/www/myproject/node_modules/next/dist/server/lib/squoosh/webp/webp_node_dec.js:404:28)
    at createWasm (/home/message/www/myproject/node_modules/next/dist/server/lib/squoosh/webp/webp_node_dec.js:427:13)
    at /home/message/www/myproject/node_modules/next/dist/server/lib/squoosh/webp/webp_node_dec.js:1349:19
    at Object.instantiateEmscriptenWasm (/home/message/www/myproject/node_modules/next/dist/server/lib/squoosh/emscripten-utils.js:15:12)
    at Object.dec (/home/message/www/myproject/node_modules/next/dist/server/lib/squoosh/codecs.js:190:42)
    at Object.decodeBuffer (/home/message/www/myproject/node_modules/next/dist/server/lib/squoosh/impl.js:55:31)

Import trace for requested module:
./src/components/errors/Maintenance.tsx
./src/pages/_error.tsx

Downgrading to Node v16 fixed the issue temporarily.

@AzariasB
Copy link

AzariasB commented Oct 4, 2022

Worked fine for me with node 18.0. Seems like the bug was introduced in a minor version of node 18

@jakearchibald
Copy link
Collaborator

Unfortunately, due to a few people leaving the team, and staffing issues resulting from the current economic climate (ugh), the CLI and libsquoosh packages are no longer actively maintained. I know that sucks, but there simply isn't the time & people to work on this. If anyone from the community wants to fork it, you have my blessing. The squoosh.app web app will continue to be supported and improved.

@jakearchibald jakearchibald closed this as not planned Won't fix, can't repro, duplicate, stale Jan 3, 2023
jeremy-goodplace added a commit to ANGIstudio/goodplace-landingspagina that referenced this issue May 11, 2023
Avoids issue in Google sqoosh, which seems to be unmaintained. See:
GoogleChromeLabs/squoosh#1260.
@Hakeemmidan
Copy link

upgrading next from 12.1.6 to 12.3.4 fixed it for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants