svelteness / kit-docs

Documentation integration for SvelteKit.
https://kitdocs.vercel.app
MIT License
457 stars 32 forks source link

Cannot find package $app #52

Closed MichaelBrunn3r closed 1 year ago

MichaelBrunn3r commented 2 years ago

Fresh install with these commands:

npm init @svelteness/kit-docs docs
> Skeleton project
> Typescript
> eslint
cd docs
pnpm i
pnpm dev

Yields this error:

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '$app' imported from ...\node_modules\.pnpm\@svelteness+kit-docs@0.23.0_svelte@3.49.0\node_modules\@svelteness\kit-docs\client\polyfills\focus-visible.js
    at new NodeError (node:internal/errors:388:5)
    at packageResolve (node:internal/modules/esm/resolve:910:9)
    at moduleResolve (node:internal/modules/esm/resolve:959:20)
    at defaultResolve (node:internal/modules/esm/resolve:1174:11)
    at ESMLoader.resolve (node:internal/modules/esm/loader:605:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:318:18)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:80:40)
    at link (node:internal/modules/esm/module_job:78:36)

The culprit:

// @svelteness/kit-docs/client/polyfills/focus-visible.js
import { browser } from '$app/env';

$app would lead me to believe this is a missing alias?

stephane-klein commented 2 years ago

@MichaelBrunn3r same error for me 😐

stephane-klein commented 2 years ago

@MichaelBrunn3r I think that this bug come from https://github.com/sveltejs/kit/pull/5005, the SvelteKit upgrade from Vite 2 to 3.

In short term, I propose to pin Vite version here (see also this comment).

cc @mihar-22

stephane-klein commented 2 years ago

@MichaelBrunn3r I think that this bug come from sveltejs/kit#5005, the SvelteKit upgrade from Vite 2 to 3.

In short term, I propose to pin Vite version here (see also this comment).

Can be fixed by https://github.com/svelteness/kit-docs/pull/56

mihar-22 commented 1 year ago

Should be resolved now on latest.