Giter VIP home page Giter VIP logo

Comments (12)

manastalukdar avatar manastalukdar commented on September 23, 2024 4

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.

manastalukdar avatar manastalukdar commented on September 23, 2024 2

Unfortunately same issue manifests with 5.2.4.

from markdown-it-anchor.

utahka avatar utahka commented on September 23, 2024 2

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.

nagaozen avatar nagaozen commented on September 23, 2024 2

@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.

chris-dura avatar chris-dura commented on September 23, 2024 1

I get this error as well for using markdown-it in a Vue app.

from markdown-it-anchor.

nagaozen avatar nagaozen commented on September 23, 2024

Should be fixed in 5.2.4. Could you please confirm?

from markdown-it-anchor.

manastalukdar avatar manastalukdar commented on September 23, 2024

@nagaozen Yes, I am also using @nuxtjs/markdownit. And the same problem persists even with the new version.

from markdown-it-anchor.

nagaozen avatar nagaozen commented on September 23, 2024

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.

nagaozen avatar nagaozen commented on September 23, 2024

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.

manastalukdar avatar manastalukdar commented on September 23, 2024

@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.

nagaozen avatar nagaozen commented on September 23, 2024

Could you please inform which version had it fixed?

from markdown-it-anchor.

manastalukdar avatar manastalukdar commented on September 23, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.