Closed shinokada closed 2 years ago
I don't know, I've never used mdsvex before but I don't see any reason why it shouldn't work. The error message also doesn't say anything about giscus.
By the way, reactions-enabled
should be reactionsEnabled
and emit-metadata
should be emitMetadata
.
If that still doesn't work, you might want to try the giscus web component.
The error seems to come from svelte-flow
, not giscus.
I removed node_modules and package-lock.json and npm i
.
I get the following error:
12:36:41 PM [vite] Error when evaluating SSR module /src/routes/layouts/doc.svelte:
ReferenceError: exports is not defined in ES module scope
This file is being treated as an ES module because it has a '.js' file extension and '/Users/shinichiokada/Svelte/svelte-flow/node_modules/@giscus/svelte/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
at file:///Users/shinichiokada/Svelte/svelte-flow/node_modules/@giscus/svelte/dist/index.cjs.js:1:36
at ModuleJob.run (node:internal/modules/esm/module_job:185:25)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:281:24)
at async importModuleDynamicallyWrapper (node:internal/vm/module:437:15)
at async nodeImport (/Users/shinichiokada/Svelte/svelte-flow/node_modules/vite/dist/node/chunks/dep-f9d9421a.js:56246:21)
at async eval (/src/routes/layouts/doc.svelte:13:31)
at async instantiateModule (/Users/shinichiokada/Svelte/svelte-flow/node_modules/vite/dist/node/chunks/dep-f9d9421a.js:56177:9)
...
VS Code gives an warning not able to find a declaration file.
Can you try installing version 1.1.2-beta.1
?
Can I install like this?
npm i @giscus/svelte@1.1.2-beta.1
Yes.
I get this error:
<Giscus> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules
Error: <Giscus> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules
at Proxy.validate_component (/Users/shinichiokada/Svelte/svelte-flow/node_modules/svelte/internal/index.js:1722:15)
at eval (/src/routes/layouts/doc.svelte:18:29)
at Object.$$render (/Users/shinichiokada/Svelte/svelte-flow/node_modules/svelte/internal/index.js:1745:22)
at default.md:10:27
at Object.$$render (/Users/shinichiokada/Svelte/svelte-flow/node_modules/svelte/internal/index.js:1745:22)
at Object.default (root.svelte:43:47)
at eval (/src/routes/__layout.svelte:127:64)
at Object.$$render (/Users/shinichiokada/Svelte/svelte-flow/node_modules/svelte/internal/index.js:1745:22)
at root.svelte:37:45
at $$render (/Users/shinichiokada/Svelte/svelte-flow/node_modules/svelte/internal/index.js:1745:22)
Check your package.json
, is @giscus/svelte
in devDependencies
? If so, move it to dependencies
and run npm i
again.
Please try with v2.0.0 and report back if the issue still happens.
I use mdsvex in my SvelteKit project. I tried to Giscus in a markdown file, but it returns an error.
My
doc.svlete
file:In one of markdown file:
One of errors is:
On my terminal error says:
I have already
postcss-load-config
installed.Any idea?