question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: plugin.apply is not a function with v4.0.0

See original GitHub issue

Running into “TypeError: plugin.apply is not a function” with version 4.0.0.

r TypeError: plugin.apply is not a function
    at MarkdownIt.push../node_modules/markdown-it/lib/index.js.MarkdownIt.use (vendors.._src_components_pages_blog__year__month__day__post.._src_components_pages_index.js:13325)
    at _callee$ (._src_components_pages_blog__year__month__day__post.19e4fd7a250bcd634c5a.hot-update.js:145)
    at tryCatch (commons.app.js:6771)
    at Generator.invoke [as _invoke] (commons.app.js:6997)
    at Generator.prototype.<computed> [as next] (commons.app.js:6823)
    at asyncGeneratorStep (vendors.app.js:31)
    at _next (vendors.app.js:53)
    at vendors.app.js:60
    at new Promise (<anonymous>)
    at vendors.app.js:49

Reproducible using this repo.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
manastalukdarcommented, Aug 30, 2019

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)
0reactions
nagaozencommented, Jul 13, 2019

Do you know what entry from package.json your bundler is using? Because using main works fine in node.js

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: plugin.apply is not a function with v5.2.4 #55 - GitHub
We've encountered a bug before when babel was transpiling the code into something else and started using exports.default instead of the Node.js ...
Read more >
webpack-cil TypeError: compiler.plugin is not a function
When I run 'npm run dev' in the terminal ,the error shows. However when I run 'npm run build', it can run sucessfully....
Read more >
Plugin.apply is not a function | Creating plugin in Vue.js
I develop a plugin and publish on npm After try use in another project, Vue.use(VueGmaps) return a error vue.common.js?e881:3140 Uncaught TypeError: ...
Read more >
How I solved and debugged my Webpack issue through trial ...
I tried to use webpack.SourceMapDevToolPlugin but it didn't work with my setup, even when I deleted devtools or set them to false; I...
Read more >
Server - Fastify
Factory. The Fastify module exports a factory function that is used to create new Fastify server instances. This factory function accepts an options...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found