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

Cannot load layout path in versions >v0.12.0 #635

Closed
jaaneh opened this issue Aug 16, 2024 · 4 comments · Fixed by #637
Closed

Cannot load layout path in versions >v0.12.0 #635

jaaneh opened this issue Aug 16, 2024 · 4 comments · Fixed by #637
Assignees
Labels
bug Something isn't working

Comments

@jaaneh
Copy link

jaaneh commented Aug 16, 2024

Trying to up from v0.10.6 to latest (0.12.2) and it results in

error during build:
Error: The layout path you provided couldn't be found at either /home/jan/dev/content/packages/lms/src/lib/components/ui/Layout.svelte or /home/jan/dev/content/packages/lms/home/jan/dev/content/packages/lms/src/lib/components/ui/Layout.svelte. Please double-check it and try again.

This works fine on any version below 0.12.0, including 0.11.1.

// svelte.config.js
import preprocess from 'svelte-preprocess';
import node from '@sveltejs/adapter-node';
import { vitePreprocess } from '@sveltejs/kit/vite';
import { mdsvex } from 'mdsvex';
import callouts from 'remark-emoji-callout';
import gfm from 'remark-gfm';
import path from 'path';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
import codeBlockPlugin from './src/lib/utils/remarkPlugins/codeBlockPlugin.js';

/** @type {import('@sveltejs/kit').Config} */
const config = {
  // Consult https://kit.svelte.dev/docs/integrations#preprocessors
  // for more information about preprocessors
  preprocess: [
    vitePreprocess(),
    mdsvex({
      layout: path.join(__dirname, './src/lib/components/ui/Layout.svelte'),
      extensions: ['.md', '.svx'],
      remarkPlugins: [
        gfm,
        callouts,
        {
          dataAttribute: 'custom-callout',
          titleTextTagName: 'span',
          iconTagName: 'span'
          // ...
        },
        codeBlockPlugin
      ]
    }),
    preprocess({
      postcss: true
    })
  ],
  extensions: ['.svelte', '.md'],

  kit: {
    adapter: node()
  }
};

export default config;

We're still on Svelte 3 and Vite 4

// package.json
"svelte": "^3.54.0",
"mdsvex": "^0.12.2",
"vite": "^4.5.3",
@pngwn
Copy link
Owner

pngwn commented Aug 16, 2024

Ah, must have screwed up the path resolution when we made some internal changes. I'll check this ASAP.

@pngwn pngwn self-assigned this Aug 16, 2024
@pngwn pngwn added the bug Something isn't working label Aug 16, 2024
@pngwn pngwn mentioned this issue Aug 17, 2024
@pngwn
Copy link
Owner

pngwn commented Aug 17, 2024

Can you try version 0.12.3 please: https://github.com/pngwn/MDsveX/releases/tag/mdsvex%400.12.3

@jaaneh
Copy link
Author

jaaneh commented Aug 17, 2024

@pngwn seems to work from what I can see. Appreciate it a bunch!

@pngwn
Copy link
Owner

pngwn commented Aug 17, 2024

Awesome, ty!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants