svelte-add: SyntaxError: mdsvex does not provide an export named mdsvex

Sorry - I’m a newbie so hope I’m giving some helpful info.

Brand new sveltekit install:

  • Skeleton Project
  • No Typescript
  • No ES Lint
  • No Prettier
  • pnpm install
  • npx svelte-add mdsvex
  • pnpm install
  • npm run dev – --port 4010

Everything seems to be working fine with no errors.

In index.svelte:

<script>
    import Example from '$lib/Example.svelte.md'
</script>

<Example />

Visual studio immediately displays an error:

Error in svelte.config.js SyntaxError: The requested module ‘mdsvex’ does not provide an export named ‘mdsvex’

The page at http://localhost:4010/ seems to be displaying perfectly however.

Can I carry on with my project? Will this error cause unexpected breaking of Svelte-kit?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

Can I then safely assume that anything I code that doesn’t work is MY fault and not because of that IDE warning?

Hmm, I’d say you can’t assume that and can only find that out with research and testing. If it’s at least somewhat related to this project, you can ask about it here (preferably in this issue we are currently in rather than a new one unless a new bug is found).

Forked your repo, @sonya-ninja. Local build is fine with NodeJS v15.3.0. Netlify build fails like yours, unless I add to netlify.toml in the root: [context.production] environment = { NODE_VERSION = “15.3.0” }

Try to update Node on whatever platform you build.