Open Magnus-Ignitic opened 7 months ago
Thanks for taking the time to write this up @Magnus-Ignitic . I just ran into the same problem and the workaround provided helped me get unstuck.
For anyone else trying to figure out where to get dirname
and fileURLToPath
from, here you go:
import { fileURLToPath } from 'node:url';
import { dirname } from 'node:path';
Summary
When adding mdsvex to a mono repo SvelteKit project (where the SvelteKit project resides in a subfolder) I get the following error in source files:
It seems the relative path is based on the workspace root folder and not the location of
svelte.config.js
.I only get the error in VSCode. Dev server and building works fine.
svelte.config.js
Workaround(?)
Using
dirname()
to get the absolute path to thesvelte.config.js
seems to work: