Comments (12)
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)
from markdown-it-anchor.
Unfortunately same issue manifests with 5.2.4.
from markdown-it-anchor.
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)
from markdown-it-anchor.
@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
from markdown-it-anchor.
I get this error as well for using markdown-it
in a Vue app.
from markdown-it-anchor.
Should be fixed in 5.2.4
. Could you please confirm?
from markdown-it-anchor.
@nagaozen Yes, I am also using @nuxtjs/markdownit
. And the same problem persists even with the new version.
from markdown-it-anchor.
This stack is really complicated. I couldn't reproduce the problem. I got:
[nagaozen@optiplex3020 website]$ npm run nuxt-dev
> [email protected] 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)
from markdown-it-anchor.
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
from markdown-it-anchor.
@nagaozen The latest version of the plugins does not mitigate the problem, which is why I had to downgrade to older versions.
from markdown-it-anchor.
Could you please inform which version had it fixed?
from markdown-it-anchor.
@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",
from markdown-it-anchor.
Related Issues (20)
- Add container around heading and anchor HOT 3
- Expose custom options regardless of permalink styles HOT 4
- Headings containing a hashtag yield invalid hrefs HOT 2
- Headers in html_block Tokens aren't given slugs HOT 11
- Add <span> inside permalink.headerLink style until safari reader more is fixed HOT 1
- incorrect type for permalink.headerLink() HOT 2
- Feature request: container option for linkAfterHeader HOT 5
- KaTeX Expressions aren't Included in Headings HOT 4
- Should return type for `PermalinkGenerator` be `void` instead of `string`? HOT 1
- Missing `wrapper` property in `LinkAfterHeaderPermalinkOptions` type HOT 1
- Add brief description of what plugin does to top of readme. HOT 1
- Types invalid with `"type": "module"` and `"moduleResolution": "Node16"` HOT 7
- @types in peerDeps HOT 2
- TypeError: c.attrGet is not a function HOT 1
- Missing #todo-anchor-or-file header in README HOT 1
- Exception 'plugin.apply is not a function' HOT 2
- Colon in header doesn't work HOT 6
- Upgrade markdown-it types to v14 HOT 1
- more icons for "symbol" HOT 3
- Query: How do I attach a class to the header element? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from markdown-it-anchor.