paoloricciuti / sveltekit-search-params

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

Cannot find package '$app' #46

Closed ollema closed 1 year ago

ollema commented 1 year ago

Describe the bug

Whenever I do a hard refresh, I get this error. Not sure what I am missing!

Reproduction

https://stackblitz.com/edit/sveltejs-kit-template-default-c78wrs?file=src%2Froutes%2F%2Bpage.svelte

Logs

00:48:40 [vite] Error when evaluating SSR module /src/routes/+page.svelte: failed to import "sveltekit-search-params"
|- Error [ERR_MODULE_NOT_FOUND]: Cannot find package '$app' imported from /home/projects/sveltejs-kit-template-default-c78wrs/node_modules/sveltekit-search-params/package/sveltekit-search-params.js
    at  (https://sveltejskittemplatedefaultc78w-xkpr.w-corp.staticblitz.com/blitz.95086023.js:36:4170)
    at packageResolve (https://sveltejskittemplatedefaultc78w-xkpr.w-corp.staticblitz.com/blitz.95086023.js:114:9613)
    at  (https://sveltejskittemplatedefaultc78w-xkpr.w-corp.staticblitz.com/blitz.95086023.js:114:11319)
    at  (https://sveltejskittemplatedefaultc78w-xkpr.w-corp.staticblitz.com/blitz.95086023.js:114:12167)
    at defaultResolve (https://sveltejskittemplatedefaultc78w-xkpr.w-corp.staticblitz.com/blitz.95086023.js:114:12837)
    at  (https://sveltejskittemplatedefaultc78w-xkpr.w-corp.staticblitz.com/blitz.95086023.js:248:2121)
    at  (https://sveltejskittemplatedefaultc78w-xkpr.w-corp.staticblitz.com/blitz.95086023.js:248:2213)
    at  (https://sveltejskittemplatedefaultc78w-xkpr.w-corp.staticblitz.com/blitz.95086023.js:248:7557)
    at resolve (https://sveltejskittemplatedefaultc78w-xkpr.w-corp.staticblitz.com/blitz.95086023.js:248:7997)
    at  (https://sveltejskittemplatedefaultc78w-xkpr.w-corp.staticblitz.com/blitz.95086023.js:248:4394)
    at getModuleJob (https://sveltejskittemplatedefaultc78w-xkpr.w-corp.staticblitz.com/blitz.95086023.js:248:4673)
    at  (https://sveltejskittemplatedefaultc78w-xkpr.w-corp.staticblitz.com/blitz.95086023.js:181:944)
    at  (https://sveltejskittemplatedefaultc78w-xkpr.w-corp.staticblitz.com/blitz.95086023.js:181:989)
    at  (https://sveltejskittemplatedefaultc78w-xkpr.w-corp.staticblitz.com/blitz.95086023.js:352:382940)
    at  (https://sveltejskittemplatedefaultc78w-xkpr.w-corp.staticblitz.com/blitz.95086023.js:181:897)

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '$app' imported from /home/projects/sveltejs-kit-template-default-c78wrs/node_modules/sveltekit-search-params/package/sveltekit-search-params.js
    at  (https://sveltejskittemplatedefaultc78w-xkpr.w-corp.staticblitz.com/blitz.95086023.js:36:4170)
    at packageResolve (https://sveltejskittemplatedefaultc78w-xkpr.w-corp.staticblitz.com/blitz.95086023.js:114:9613)
    at  (https://sveltejskittemplatedefaultc78w-xkpr.w-corp.staticblitz.com/blitz.95086023.js:114:11319)
    at  (https://sveltejskittemplatedefaultc78w-xkpr.w-corp.staticblitz.com/blitz.95086023.js:114:12167)
    at defaultResolve (https://sveltejskittemplatedefaultc78w-xkpr.w-corp.staticblitz.com/blitz.95086023.js:114:12837)
    at  (https://sveltejskittemplatedefaultc78w-xkpr.w-corp.staticblitz.com/blitz.95086023.js:248:2121)
    at  (https://sveltejskittemplatedefaultc78w-xkpr.w-corp.staticblitz.com/blitz.95086023.js:248:2213)
    at  (https://sveltejskittemplatedefaultc78w-xkpr.w-corp.staticblitz.com/blitz.95086023.js:248:7557)
    at resolve (https://sveltejskittemplatedefaultc78w-xkpr.w-corp.staticblitz.com/blitz.95086023.js:248:7997)
    at  (https://sveltejskittemplatedefaultc78w-xkpr.w-corp.staticblitz.com/blitz.95086023.js:248:4394)
    at getModuleJob (https://sveltejskittemplatedefaultc78w-xkpr.w-corp.staticblitz.com/blitz.95086023.js:248:4673)
    at  (https://sveltejskittemplatedefaultc78w-xkpr.w-corp.staticblitz.com/blitz.95086023.js:181:944)
    at  (https://sveltejskittemplatedefaultc78w-xkpr.w-corp.staticblitz.com/blitz.95086023.js:181:989)
    at  (https://sveltejskittemplatedefaultc78w-xkpr.w-corp.staticblitz.com/blitz.95086023.js:352:382940)
    at  (https://sveltejskittemplatedefaultc78w-xkpr.w-corp.staticblitz.com/blitz.95086023.js:181:897) {
  code: 'ERR_MODULE_NOT_FOUND'
}
ollema commented 1 year ago

super weird - this only happens if you install the package while keeping the dev server running. usually this works great for other packages, but for this one I had to manually restart the dev server