paoloricciuti / sveltekit-search-params

The easiest way to read and WRITE from query parameters in sveltekit.
https://sveltekit-search-params.netlify.app
MIT License
497 stars 15 forks source link

Error exporting compressToEncodedURIComponent #7

Closed KarolusD closed 1 year ago

KarolusD commented 1 year ago
client-manifest.js:28 SyntaxError: The requested module '/node_modules/.pnpm/lz-string@1.4.4/node_modules/lz-string/libs/lz-string.js?v=2285ece9' does not provide an export named 'compressToEncodedURIComponent' (at sveltekit-search-params.js?v=2285ece9:7:10)
handleError @ client-manifest.js:28

using:

"@sveltejs/adapter-auto": "next",
"@sveltejs/kit": "1.0.0-next.561",
KarolusD commented 1 year ago

image

also getting some warning when installing via pnpm

paoloricciuti commented 1 year ago

That's curious...I'll take a look as soon as I can

swyxio commented 1 year ago

having the same issue causing 500 in sveltekit

image

however when i refreshed it disappeared...

paoloricciuti commented 1 year ago

Mmm I wonder why I never had this problem...it should be because lz-string is commonjs and I'm importing as a module.

paoloricciuti commented 1 year ago

Ok as i've suspected it's a pnpm problem it seems...i'm debugging this right now if i'm successfull i'll publish a new version soon

paoloricciuti commented 1 year ago

@sw-yx @KarolusD it should be fixed on the newest release 0.1.12. I'm closing this issue for the moment, feel free to reply if you still have the problem and i'll reopen this.

swyxio commented 1 year ago

thank you!

swyxio commented 1 year ago

@paoloricciuti :( image

paoloricciuti commented 1 year ago

Wtf I didn't publish anything and lz-string did not publish either how is this all of a sudden broken? Is this a new project? Could this be a cache issue with pnpm?

paoloricciuti commented 1 year ago

@sw-yx this should hopefully be the last time we have this problem...i've decided to remove lz-string as a dependency and keep a slimmed down version of the library with the correct export in ESM (with proper attribution obviosuly).

Let me know if 0.1.13 fixes it for you (it does for me in local).

swyxio commented 1 year ago

ty! no its still my swyxkit project, and i was not using pnpm

swyxio commented 1 year ago

yes 0.1.13 seems to work now!

paoloricciuti commented 1 year ago

ty! no its still my swyxkit project, and i was not using pnpm

it's absolutely crazy how it can randomly break. I guess it's because of this code inside lz-string

https://github.com/pieroxy/lz-string/blob/2f749bc9fe3cc889fa9e32d2769a930d977596e6/libs/lz-string.js#L497-506

which does some crazy things. Overall i'll gladly take care of it in an extra file inside my codebase especially since lz-string was last published 8 years ago

Closing this issue now.