0

So I wanted to add MDSVEX to my sveltekit project. It works great when trying it locally on my machine. But I get the following error when deploying my code to vercel:

Error: Could not load /vercel/path0/src/lib/Instructions.md (imported by src/routes/+page.svelte): ENOENT: no such file or directory, open '/vercel/path0/src/lib/Instructions.md'

Error: Command "npm run build" exited with 1

Deployment completed

BUILD_UTILS_SPAWN_1: Command "npm run build" exited with 1

Here is my code

mdsvex.config.js:

import { defineMDSveXConfig as defineConfig } from 'mdsvex';

const config = defineConfig({
    extensions: ['.svelte.md', '.md', '.svx'],
    smartypants: {
        dashes: 'oldschool'
    },
    remarkPlugins: [],
    rehypePlugins: []
});

export default config;

svelte.config.js:

import adapter from '@sveltejs/adapter-auto';
import { mdsvex } from "mdsvex";
import mdsvexConfig from './mdsvex.config.js';


/** @type {import('@sveltejs/kit').Config} */
const config = {
    extensions: [".svelte", ...mdsvexConfig.extensions],
    kit: {
        adapter: adapter()
    },
    preprocess: [mdsvex(mdsvexConfig)]
};

export default config;

+page.svelte:

<script>
    import Instructions from '$lib/Instructions.md';

</script>
<Instructions />

What is the problem here?

JJ77
  • 55
  • 8
  • What is the output of `ls src/lib` locally? – Dogbert Apr 26 '23 at 15:37
  • 1
    Thanks, this helped me solve it. The file is actually called "instructions.md" (lowercase, not uppercase). Since Windows is not case-sensitive, I did not have a problem locally. – JJ77 Apr 27 '23 at 06:18

0 Answers0