-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Layout relative path problem with monorepo and VSCode #556
Comments
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 import { fileURLToPath } from 'node:url';
import { dirname } from 'node:path'; |
* Add workspace level (recursive) `pnpm check` * Fix VSCode not displaying errors due to monorepo handling of mdsvex layout. Related: pngwn/MDsveX#556 * Cleanup warnings/TS errors on docs components (except GeoDebug) * Add `chartContext()` to get strongly typed chart context (from LayerCake) * More TS / a11y improvements * More TS / a11y improvements * Fix/workaround remaining TS / a11y improvements in src/lib * Fix remaining a11y warnings * Add types to topojson data and other type improvements * More progress * Ignore autoType TS error (unsure how to make it happy) * More type progress (AnyScale, etc) * More type progress * More type progress * More progress (90 to go) * Rework accessor and use consistently. More type fixes * Improve types of create series data generators * Fix ts warnings on Bars and Columns examples * Replace `@ts-ignore` with `@ts-expect-error` * More type fixes/workarounds * Update Svelte UX with improved MenuOption type * Hacks to make typescript happy in template * Allow <Chart {xDomain}> to be `null` or `null[]` to support Brush use cases * Support array as well as tuple for `null` | `number` domains * [Brush] Support passing Date for min/max. Cast `Date[]` xDomain example as `[Date, Date]` * Add changesets * Run svelte-check during CI * Add missing `@types/d3-color` and `@types/d3-path` packages * [Chart] Improve default value jsdoc comments * Add changeset * Fix createDimensionGetter() for non-band scales (ex. <Labels> on Area chart) * Use pattern for individual bar highlighting * Tween all histogram examples * Fix sparkbar tooltip example * Hide overflow on ForceGraph examples * Cleanup console.logs
I had a similar issue with Jetbrains Rider/Webstorm which ends up running with the current directory being the settings directory of the IDE. Also, just as a note, there's a newer
But it requires node 20.11.0+ |
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:The text was updated successfully, but these errors were encountered: