carta icon indicating copy to clipboard operation
carta copied to clipboard

SvelteKitError: Not found: /Toolbar.svelte

Open amin3141 opened this issue 8 months ago • 6 comments

Sorry if this is a newbie question, but I'm running 4.8.1:

> pnpm why carta-md
Legend: production dependency, optional only, dev only

[email protected] F:\data\workspaces\pairsys\court-demo\fe\hammertime (PRIVATE)

dependencies:
@cartamd/plugin-code 4.1.1
└── carta-md 4.8.1 peer
carta-md 4.8.1

And I see the Toolbar.svelte cannot be found.

SvelteKitError: Not found: /Toolbar.svelte
    at resolve (F:\data\workspaces\pairsys\court-demo\fe\hammertime\node_modules\.pnpm\@[email protected]_@svelt_0c85fcf12a1861d20f92f36645a3ecca\node_modules\@sveltejs\kit\src\runtime\server\respond.js:552:13)
    at resolve (F:\data\workspaces\pairsys\court-demo\fe\hammertime\node_modules\.pnpm\@[email protected]_@svelt_0c85fcf12a1861d20f92f36645a3ecca\node_modules\@sveltejs\kit\src\runtime\server\respond.js:352:5)
    at Object.eval [as handle] (F:\data\workspaces\pairsys\court-demo\fe\hammertime\node_modules\.pnpm\@[email protected]_@svelt_0c85fcf12a1861d20f92f36645a3ecca\node_modules\@sveltejs\kit\src\runtime\server\index.js:76:56)
    at respond (F:\data\workspaces\pairsys\court-demo\fe\hammertime\node_modules\.pnpm\@[email protected]_@svelt_0c85fcf12a1861d20f92f36645a3ecca\node_modules\@sveltejs\kit\src\runtime\server\respond.js:349:40)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
  status: 404,
  text: 'Not Found'
}

Looking into my pnpm directory, everything seems to be there:

Image

For reference, here's the line in MarkdownEditor.svelte that seems to cause the issue:

import Toolbar from './internal/components/Toolbar.svelte';

amin3141 avatar Mar 03 '25 23:03 amin3141

Hi, that's weird. Have you tried restarting the dev server, clearing cache and reinstalling all the node modules? I cannot seem to be able to replicate it

BearToCode avatar Mar 04 '25 06:03 BearToCode

I don't know, I tried the following in WSL:

rm -rf .svelte-kit/
rm -rf node_modules
rm pnpm-lock.yaml

Followed by this in Powershell (I'm in a Windows 11 environment):

pnpm install
pnpm run dev

And I still end up with this error:

SvelteKitError: Not found: /Toolbar.svelte
    at resolve (F:\data\workspaces\pairsys\court-demo\fe\hammertime\node_modules\.pnpm\@[email protected]_@svelt_8ebb897da2b3e94d831aa87939aa41cc\node_modules\@sveltejs\kit\src\runtime\server\respond.js:552:13)
    at resolve (F:\data\workspaces\pairsys\court-demo\fe\hammertime\node_modules\.pnpm\@[email protected]_@svelt_8ebb897da2b3e94d831aa87939aa41cc\node_modules\@sveltejs\kit\src\runtime\server\respond.js:352:5)
    at Object.eval [as handle] (F:\data\workspaces\pairsys\court-demo\fe\hammertime\node_modules\.pnpm\@[email protected]_@svelt_8ebb897da2b3e94d831aa87939aa41cc\node_modules\@sveltejs\kit\src\runtime\server\index.js:76:56)
    at respond (F:\data\workspaces\pairsys\court-demo\fe\hammertime\node_modules\.pnpm\@[email protected]_@svelt_8ebb897da2b3e94d831aa87939aa41cc\node_modules\@sveltejs\kit\src\runtime\server\respond.js:349:40)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async file:///F:/data/workspaces/pairsys/court-demo/fe/hammertime/node_modules/.pnpm/@[email protected]_@svelt_8ebb897da2b3e94d831aa87939aa41cc/node_modules/@sveltejs/kit/src/exports/vite/dev/index.js:547:22 {
  status: 404,
  text: 'Not Found'
}

I'll update this thread with a resolution when I find one. Maybe someone else is running into something similar, so it'll be useful.

amin3141 avatar Mar 04 '25 18:03 amin3141

I created a brand new app from scratch using pnpm, and it works fine. I'm sorry but with this limited info I can't do much. If you find out something more let me know!

BearToCode avatar Mar 04 '25 20:03 BearToCode

For those landing on this page in the future: I encountered the same error. I’m not entirely sure why it happened, but switching from "@sveltejs/adapter-auto": "^4.0.0" to "@sveltejs/adapter-node": "^5.2.12" in my package.json (and of course import adapter from '@sveltejs/adapter-node' in svelte.config.js) resolved the issue for me.

roysharon avatar Apr 16 '25 16:04 roysharon

I am on v4.10.1 and I'm still seeing this same issue, I did try to upgrade "@sveltejs/adapter-node": "^5.2.12", but no to no avail. The component is in the right place, like in @amin3141 's screenshot above.

chunk-2MNFTYYD.js?v=fb757311:1500 Uncaught ReferenceError: Toolbar is not defined

	in MarkdownEditor.svelte
	in example.svelte
	in component.svelte
	in +page.svelte
	in +layout.svelte
	in +layout.svelte
	in layout.svelte
	in root.svelte

gcrater avatar May 15 '25 18:05 gcrater

I am also running into the same issue. I got a working editor again by rolling back to v4.7.0, tried with every minor version from 8 to 11.

Svelte: v5.39.8 Sveltekit: v2.43.7 Vite: v7.1.8

lowlandghost avatar Oct 02 '25 16:10 lowlandghost