ipx icon indicating copy to clipboard operation
ipx copied to clipboard

SVG images fail to load in production only (works fine in dev)

Open maximepvrt opened this issue 3 weeks ago • 4 comments

Environment

node v20.19.1

Reproduction

https://stackblitz.com/edit/github-vin71jng

Describe the bug

I'm encountering an issue with SVG images only in production.

{
"error": {
"message": "[500] [IPX_ERROR] Cannot find module '../data/patch.json'\nRequire stack:\n- /home/bas/app_51d91368-11bf-46dc-9734-426830409073/benevolt/.output/server/node_modules/.nitro/[email protected]/lib/data-patch.js"
}
}

Additional context

No response

Logs


maximepvrt avatar Dec 09 '25 21:12 maximepvrt

@sgarner it's same as your issue https://github.com/unjs/ipx/issues/261 ?

maximepvrt avatar Dec 09 '25 21:12 maximepvrt

Issue with bundling svgo sub-deps (happening with Nuxt/rollup, I guess) has been solved in v4 (https://github.com/unjs/ipx/releases/tag/v4.0.0-alpha.1)

Since currently there are no API breaking changes, i guess you might try fix by force resolving ipx version.

pi0 avatar Dec 09 '25 22:12 pi0

@pi0 I tried, but I got this error:

The requested module 'file:///Users/maxime/Repos/ligilab-front/node_modules/.pnpm/[email protected][email protected][email protected][email protected][email protected]_/node_modules/ipx/dist/index.mjs' does not provide an export named 'createIPXH3Handler'

maximepvrt avatar Dec 10 '25 11:12 maximepvrt

Ah right! Image module needs to migrate to new APIs.

pi0 avatar Dec 10 '25 12:12 pi0