svelteness / kit-docs

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

"@svelteness/kit-docs/client/components/layout/Sidebar.svelte:73:9 Unexpected character '@'" error #58

Open stephane-klein opened 2 years ago

stephane-klein commented 2 years ago

In this fresh KitDocs project, I have @svelteness/kit-docs/client/components/layout/Sidebar.svelte:73:9 Unexpected character '@ error.

Here is how to reproduce:

$ git clone git@github.com:stephane-klein/kit-docs-playground.git
$ git checkout -b issue3 59d16ad26d358237dc1a0361641530259fdc439b
$ cd kit-docs-playground/services/kit-docs
$ pnpm install
$ pnpm run dev

Go to http://127.0.0.1:3000/, I have this error:

/home/stephane/git/github.com/stephane-klein/kit-docs-playground/services/kit-docs/node_modules/.pnpm/@svelteness+kit-docs@0.23.0_svelte@3.44.0/node_modules/@svelteness/kit-docs/client/components/layout/Sidebar.svelte:73:9 Unexpected character '@' (x2)
/home/stephane/git/github.com/stephane-klein/kit-docs-playground/services/kit-docs/node_modules/.pnpm/@svelteness+kit-docs@0.23.0_svelte@3.44.0/node_modules/@svelteness/kit-docs/client/components/layout/Sidebar.svelte:73:9 Unexpected character '@'
 71 |      <ul class={clsx(!search && 'mt-8', 'pb-28 992:pb-0')}>
 72 |        {#each Object.keys($config.links) as category (category)}
 73 |          {@const links = $config.links[category]}
                ^
 74 |          <li class="992:mt-10 mt-12 first:mt-0">
 75 |            {#if category !== '.'}
Function called outside component initialization
Error: Function called outside component initialization
    at get_current_component (/node_modules/.pnpm/svelte@3.44.0/node_modules/svelte/internal/index.mjs:938:15)
    at Module.setContext (/node_modules/.pnpm/svelte@3.44.0/node_modules/svelte/internal/index.mjs:968:5)
    at root.svelte:15:1
    at $$render (/node_modules/.pnpm/svelte@3.44.0/node_modules/svelte/internal/index.mjs?v=e7fad255:1681:22)
    at Object.render (/node_modules/.pnpm/svelte@3.44.0/node_modules/svelte/internal/index.mjs?v=e7fad255:1689:26)
    at render_response (file:///home/stephane/git/github.com/stephane-klein/kit-docs-playground/services/kit-docs/.svelte-kit/runtime/server/index.js:1383:27)
    at async respond_with_error (file:///home/stephane/git/github.com/stephane-klein/kit-docs-playground/services/kit-docs/.svelte-kit/runtime/server/index.js:2758:10)
    at async respond$1 (file:///home/stephane/git/github.com/stephane-klein/kit-docs-playground/services/kit-docs/.svelte-kit/runtime/server/index.js:2834:10)
    at async resolve (file:///home/stephane/git/github.com/stephane-klein/kit-docs-playground/services/kit-docs/.svelte-kit/runtime/server/index.js:3346:11)
    at async respond (file:///home/stephane/git/github.com/stephane-klein/kit-docs-playground/services/kit-docs/.svelte-kit/runtime/server/index.js:3290:20)
Function called outside component initialization
Error: Function called outside component initialization
    at get_current_component (/node_modules/.pnpm/svelte@3.44.0/node_modules/svelte/internal/index.mjs:938:15)
    at Module.setContext (/node_modules/.pnpm/svelte@3.44.0/node_modules/svelte/internal/index.mjs:968:5)
    at root.svelte:15:1
    at $$render (/node_modules/.pnpm/svelte@3.44.0/node_modules/svelte/internal/index.mjs?v=e7fad255:1681:22)
    at Object.render (/node_modules/.pnpm/svelte@3.44.0/node_modules/svelte/internal/index.mjs?v=e7fad255:1689:26)
    at render_response (file:///home/stephane/git/github.com/stephane-klein/kit-docs-playground/services/kit-docs/.svelte-kit/runtime/server/index.js:1383:27)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async respond_with_error (file:///home/stephane/git/github.com/stephane-klein/kit-docs-playground/services/kit-docs/.svelte-kit/runtime/server/index.js:2758:10)
    at async resolve (file:///home/stephane/git/github.com/stephane-klein/kit-docs-playground/services/kit-docs/.svelte-kit/runtime/server/index.js:3391:13)
    at async respond (file:///home/stephane/git/github.com/stephane-klein/kit-docs-playground/services/kit-docs/.svelte-kit/runtime/server/index.js:3290:20)

Versions:

$ pnpm list
Legend: production dependency, optional only, dev only

mydocs@0.0.1 /home/stephane/git/github.com/stephane-klein/kit-docs-playground/services/kit-docs

dependencies:
@fontsource/fira-mono 4.5.0
cookie 0.4.1

devDependencies:
@iconify-json/ri 1.1.1                @sveltejs/kit 1.0.0-next.370          clsx 1.1.1                            eslint-config-prettier 8.3.0          prettier 2.6.2                        shiki 0.10.1                          unplugin-icons 0.13.4
@sveltejs/adapter-auto 1.0.0-next.57  @svelteness/kit-docs 0.23.0           eslint 8.16.0                         eslint-plugin-svelte3 4.0.0           prettier-plugin-svelte 2.7.0          svelte 3.44.0                         vite 2.9.14

Have you an idea to fix this error?

LowLevelLover commented 1 year ago

I test it with sveltekit v1.0.0 and svelte v3.54.0. Everything works perfect.