Skip to content
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

bug: ext.startsWith is not a function #681

Open
midirhee12 opened this issue Dec 27, 2024 · 1 comment
Open

bug: ext.startsWith is not a function #681

midirhee12 opened this issue Dec 27, 2024 · 1 comment

Comments

@midirhee12
Copy link

After adding this to the svelte.config.js:

    mdsvex({
      extension: [".md", ".svx"],
    }),

I get the following:

TypeError: Error while preprocessing /home/midirhee12/Projects/midirhee12/personal-website/main/.svelte-kit/generated/root.svelte - ext.startsWith is not a function
    at /home/midirhee12/Projects/midirhee12/personal-website/main/node_modules/.pnpm/[email protected][email protected]/node_modules/mdsvex/dist/main.cjs.js:24416:71
    at Array.map (<anonymous>)
    at markup (/home/midirhee12/Projects/midirhee12/personal-website/main/node_modules/.pnpm/[email protected][email protected]/node_modules/mdsvex/dist/main.cjs.js:24416:56)
    at process_markup (file:///home/midirhee12/Projects/midirhee12/personal-website/main/node_modules/.pnpm/[email protected]/node_modules/svelte/src/compiler/preprocess/index.js:309:26)
    at Module.preprocess (file:///home/midirhee12/Projects/midirhee12/personal-website/main/node_modules/.pnpm/[email protected]/node_modules/svelte/src/compiler/preprocess/index.js:355:31)
    at async compileSvelte (file:///home/midirhee12/Projects/midirhee12/personal-website/main/node_modules/.pnpm/@[email protected][email protected][email protected]_@[email protected]_/node_modules/@sveltejs/vite-plugin-svelte/src/utils/compile.js:85:20)
    at async TransformPluginContext.transform (file:///home/midirhee12/Projects/midirhee12/personal-website/main/node_modules/.pnpm/@[email protected][email protected][email protected]_@[email protected]_/node_modules/@sveltejs/vite-plugin-svelte/src/index.js:148:20)
    at async PluginContainer.transform (file:///home/midirhee12/Projects/midirhee12/personal-website/main/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:49096:18)
    at async loadAndTransform (file:///home/midirhee12/Projects/midirhee12/personal-website/main/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:51929:27)
    at async instantiateModule (file:///home/midirhee12/Projects/midirhee12/personal-website/main/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:52874:44)

Seems to be related to:

ext.startsWith('.') ? ext : '.' + ext

@github-project-automation github-project-automation bot moved this to Triage + Refine in mdsvex Dec 27, 2024
@HannesT117
Copy link

Hi @midirhee12 I just had the same issue - there is both extension and extensions available. The first is deprecated and can only work with a (single) string. The latter (extensions) is the way to go if you want to pass an array :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Triage + Refine
Development

No branches or pull requests

2 participants