JonasKruckenberg / imagetools

Load and transform images using a toolbox :toolbox: of custom import directives!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Broken search params in v5

mxdvl opened this issue · comments

Since upgrading to version 5, my project has stopped building.

Could not load /project/some/image.jpg (imported by src/routes/(main)/+page.svelte): context.manualSearchParams.has is not a function
    at resizeTransform (file:///project/node_modules/.pnpm/imagetools-core@4.0.1/node_modules/imagetools-core/dist/index.js:279:44)
    at applyTransforms (file:///project/node_modules/.pnpm/imagetools-core@4.0.1/node_modules/imagetools-core/dist/index.js:530:23)
    at async Object.load (file:///project/node_modules/.pnpm/vite-imagetools@5.0.0/node_modules/vite-imagetools/dist/index.js:63:45)

Worth noting that vite dev seems to work fine.

As seen in mxdvl/mxdvl#309

I have no idea why this could be, I've been testing locally and everything seems to work just fine.
My only two ideas are:

  • Vercel's nodes version is somehow incredibly outdated OR
  • they override the builtin URLSearchParams class

This error is what I get when running this locally, with Node v18.16.0

Seems fixed in 5.0.2