Error when adding a new remark plugin ?
Environment
- Operating System:
Linux - Node Version:
v18.9.0 - Nuxt Version:
3.0.0-rc.11 - Nitro Version:
0.5.4 - Package Manager:
[email protected] - Builder:
vite - User Config:
- - Runtime Modules:
- - Build Modules:
-
Reproduction
I want to install the remark-admonitions plugin, and here's what I did :
npm i --save-dev remark-admonitions
I tried different ways for adding the plugin :
import admonitions from 'remark-admonitions';
export default defineNuxtConfig({
(...)
content: {
markdown: {
remarkPlugins: {
'remark-admonitions': {},
},
},
from here, I got an error :
[nuxt] [request error] [unhandled] [500] Cannot read properties of undefined (reading 'blockTokenizers')
So I tried the way it is described in the only ref given when talking about custom plugins : https://github.com/nuxt/content/blob/main/src/runtime/markdown-parser/index.ts#L23
and I got the same error :
[nuxt] [request error] [unhandled] [500] Cannot read properties of undefined (reading 'blockTokenizers')
content: {
markdown: {
remarkPlugins: {
'remark-admonitions': {
instance: admonitions,
},
},
},
Describe the bug
It's probably not a bug, but since I can't read any example I feel like I try copying one source or an other, and I can't make it work.
I'd like to import a remark plugin, and be able to customize its options.
Thanks for your help, hope my post is alright, did my best. Cheers from France !
Additional context
No response
Logs
ERROR (node:84522) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
ℹ Vite client warmed up in 762ms 14:57:58
✔ Nitro built in 853 ms nitro 14:57:59
(node:84522) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
[nuxt] [request error] [unhandled] [500] Cannot read properties of undefined (reading 'blockTokenizers')
at Function.attacher (./node_modules/remark-admonitions/lib/index.js:214:10)
at Function.freeze (./node_modules/unified/lib/index.js:136:36)
at Function.process (./node_modules/unified/lib/index.js:375:15)
at ./.nuxt/dev/index.mjs:1734:12
at new Promise (<anonymous>)
at generateBody (./.nuxt/dev/index.mjs:1725:10)
at parse (./.nuxt/dev/index.mjs:1807:22)
at async Object.parse (./.nuxt/dev/index.mjs:1852:20)
at async transformContent (./.nuxt/dev/index.mjs:2004:18)
at async parseContent (./.nuxt/dev/index.mjs:2251:18)
[nuxt] [request error] [unhandled] [500] Cannot read properties of undefined (reading 'blockTokenizers')
at Function.attacher (./node_modules/remark-admonitions/lib/index.js:214:10)
at Function.freeze (./node_modules/unified/lib/index.js:136:36)
at Function.process (./node_modules/unified/lib/index.js:375:15)
at ./.nuxt/dev/index.mjs:1734:12
at new Promise (<anonymous>)
at generateBody (./.nuxt/dev/index.mjs:1725:10)
at parse (./.nuxt/dev/index.mjs:1807:22)
at async Object.parse (./.nuxt/dev/index.mjs:1852:20)
at async transformContent (./.nuxt/dev/index.mjs:2004:18)
at async parseContent (./.nuxt/dev/index.mjs:2251:18)
[nuxt] [request error] [unhandled] [500] Cannot read properties of undefined (reading 'blockTokenizers')
at Function.attacher (./node_modules/remark-admonitions/lib/index.js:214:10)
at Function.freeze (./node_modules/unified/lib/index.js:136:36)
at Function.process (./node_modules/unified/lib/index.js:375:15)
at ./.nuxt/dev/index.mjs:1734:12
at new Promise (<anonymous>)
at generateBody (./.nuxt/dev/index.mjs:1725:10)
at parse (./.nuxt/dev/index.mjs:1807:22)
at async Object.parse (./.nuxt/dev/index.mjs:1852:20)
at async transformContent (./.nuxt/dev/index.mjs:2004:18)
at async parseContent (./.nuxt/dev/index.mjs:2251:18)
[nuxt] [request error] [unhandled] [500] Cannot read properties of undefined (reading 'blockTokenizers')
at Function.attacher (./node_modules/remark-admonitions/lib/index.js:214:10)
at Function.freeze (./node_modules/unified/lib/index.js:136:36)
at Function.process (./node_modules/unified/lib/index.js:375:15)
at ./.nuxt/dev/index.mjs:1734:12
at new Promise (<anonymous>)
at generateBody (./.nuxt/dev/index.mjs:1725:10)
at parse (./.nuxt/dev/index.mjs:1807:22)
at async Object.parse (./.nuxt/dev/index.mjs:1852:20)
at async transformContent (./.nuxt/dev/index.mjs:2004:18)
at async parseContent (./.nuxt/dev/index.mjs:2251:18)
Seems that remark-admonitions does not support latest remark.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.