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

+page.markdoc is not found - SvelteKit #7

Open
hshoob opened this issue Oct 20, 2022 · 2 comments
Open

+page.markdoc is not found - SvelteKit #7

hshoob opened this issue Oct 20, 2022 · 2 comments

Comments

@hshoob
Copy link

hshoob commented Oct 20, 2022

I think svelte-markdoc doesn't work with the latest SvelteKit. Check the setup and error below:

// package.json:

{
  "name": "markdoc-demo",
  "version": "0.0.1",
  "scripts": {
     "dev": "vite dev",
     "build": "svelte-kit sync && svelte-package",
     "lint": "prettier --check .",
     "format": "prettier --write ."
   },
  "devDependencies": {
     "@sveltejs/adapter-auto": "next",
     "@sveltejs/kit": "next",
     "@sveltejs/package": "next",
     "autoprefixer": "^10.4.7",
     "postcss": "^8.4.14",
     "postcss-load-config": "^4.0.1",
     "prettier": "^2.6.2",
     "prettier-plugin-svelte": "^2.7.0",
     "svelte": "^3.44.0",
     "svelte-preprocess": "^4.10.7",
     "typescript": "^4.8.2",
     "vite": "^3.1.0",
     "svelte-markdoc": "^0.0.1",
   },
  "type": "module",
  "dependencies": {
   }
}
// markdoc.config.js

export default {
  variables: {
     title: 'My awesome site'
   }
};
// svelte.config.js

import adapter from '@sveltejs/adapter-auto';
import preprocessMarkdoc from 'svelte-markdoc';
import markdocConfig from './markdoc.config.js';

const config = {
  extensions: ['.svelte', '.markdoc'],
    kit: {
      adapter: adapter()
    },
      preprocess: {
         markup: preprocessMarkdoc(markdocConfig)
      }
};

export default config;

Routing is:

src
 └ routes
    └ +layout.svelte
    └ +page.svelte
    └ +page.markdoc

The error I get:

Not found: /+page.markdoc
Error: Not found: /+page.markdoc

Wondering what could be causing this.

@joshnuss
Copy link
Owner

Hi,

The package will need to be updated to support the new routing changes.
It probably will require having a +server.js route that renders the .markdoc files server-side.

@hshoob
Copy link
Author

hshoob commented Oct 28, 2022

The package will need to be updated to support the new routing changes. It probably will require having a +server.js route that renders the .markdoc files server-side.

Can you fix it, please?

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

No branches or pull requests

2 participants