Closed manastalukdar closed 5 years ago
Should be fixed in 5.2.4
. Could you please confirm?
Unfortunately same issue manifests with 5.2.4.
I have similar issue with 5.2.4
I am using this plugin with @nuxtjs/markdownit, and get following error.
TypeError: plugin.apply is not a function
at MarkdownIt.push../node_modules/markdown-it/lib/index.js.MarkdownIt.use (vendors.app.js:3597)
at app.js:2322
at _callee2$ (app.js:2224)
at tryCatch (commons.app.js:6088)
at Generator.invoke [as _invoke] (commons.app.js:6322)
at Generator.prototype.<computed> [as next] (commons.app.js:6140)
at asyncGeneratorStep (commons.app.js:31)
at _next (commons.app.js:53)
@manastalukdar are you also using @nuxtjs/markdownit
? Could you please check if it works with the original source? https://www.npmjs.com/package/markdown-it
@nagaozen Yes, I am also using @nuxtjs/markdownit
. And the same problem persists even with the new version.
I get this error as well for using markdown-it
in a Vue app.
This stack is really complicated. I couldn't reproduce the problem. I got:
[nagaozen@optiplex3020 website]$ npm run nuxt-dev
> manas.talukdar.personal.website@1.0.0 nuxt-dev /run/media/nagaozen/OS/sandbox/manastalukdar.github.io/website
> nuxt
╭─────────────────────────────────────────────╮
│ │
│ Nuxt.js v2.8.0 │
│ Running in development mode (universal) │
│ │
│ Listening on: http://localhost:3000/ │
│ │
╰─────────────────────────────────────────────╯
ℹ Preparing project for development 15:46:18
ℹ Initial build may take a while 15:46:18
✔ Builder initialized 15:46:18
✔ Nuxt files generated 15:46:19
✖ Client
Compiled with some errors in 4.94s
● Server █████████████████████████ building (40%) 258/275 modules 17 active
vuetify-loader › vue-loader › src/components/other/blog/single-post/comments.vue
ERROR Failed to compile with 1 errors friendly-errors 15:46:26
Module build failed (from ./node_modules/eslint-loader/index.js): friendly-errors 15:46:26
Error: Cannot find module 'eslint/lib/formatters/stylish'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.module.exports (/run/media/nagaozen/OS/sandbox/manastalukdar.github.io/website/node_modules/eslint-loader/index.js:199:26)
friendly-errors 15:46:26
You may use special comments to disable some warnings. friendly-errors 15:46:26
Use // eslint-disable-next-line to ignore the next line. friendly-errors 15:46:26
Use /* eslint-disable */ to ignore all warnings in a file. friendly-errors 15:46:26
✖ Client
Compiled with some errors in 4.94s
✔ Server
Compiled successfully in 22.00s
ℹ Waiting for file changes 15:46:43
ℹ Memory usage: 253 MB (RSS: 456 MB)
Couldn't get it to work, but I noticed in the packages.json that this stack is using an old version of the plugins. You may try:
npm update
npm i markdown-it-anchor@latest -S
npm i markdown-it-toc-done-right@latest -S
This should fix the issue
@nagaozen The latest version of the plugins does not mitigate the problem, which is why I had to downgrade to older versions.
Could you please inform which version had it fixed?
@nagaozen Versions below do not cause the issue. Newer versions do.
"markdown-it-anchor": "5.0.2" "markdown-it-toc-done-right": "3.0.1",
Fixed by including packages using the import
statement:
import markdownItAnchor from 'markdown-it-anchor'
import markdownItTocDoneRight from 'markdown-it-toc-done-right'
const md = require('markdown-it')
.use(markdownItAnchor, {
permalink: true,
permalinkBefore: true,
permalinkSymbol: '' // §
})
.use(markdownItTocDoneRight)
Running into "TypeError: plugin.apply is not a function" with version 5.2.3.
Reproducible using this repo.