Skip to content

Conversation

@boydaihungst
Copy link
Contributor

Use this new build command to build markdown-preview. Fix tslib module not found when npm is installed by asdf.

📑 Description

ℹ Additional Information

Link to the author: iamcco/markdown-preview.nvim#690 (comment)

@github-actions
Copy link

github-actions bot commented Sep 13, 2025

Review Checklist

Does this PR follow the [Contribution Guidelines](development guidelines)? Following is a partial checklist:

Proper conventional commit scoping:

  • If you are adding a new plugin, the scope would be the name of the category it is being added into. ex. feat(utility): added noice.nvim plugin

  • If you are modifying a pre-existing plugin or pack, the scope would be the name of the plugin folder. ex. fix(noice-nvim): fix LSP handler error

  • Pull request title has the appropriate conventional commit type and scope where the scope is the name of the pre-existing directory in the project as described above

  • README is properly formatted and uses fenced in links with <url> unless they are inside a [title](url)

  • Entry returns a single plugin spec with the new plugin as the only top level spec (not applicable for recipes or packs).

  • Proper usage of opts table rather than setting things up with the config function.

  • Proper usage of specs table for all specs that are not dependencies of a given plugin (not applicable for recipes or packs).

@boydaihungst boydaihungst changed the title fix(markdown-preview): use new build command. fix(markdown): use new build command for markdown-preview. Sep 13, 2025
@Uzaaft
Copy link
Member

Uzaaft commented Sep 14, 2025

This is just an alternative method on how to build this, I dont see what advantage it will provide over the current approach.
Also, the comment u linked to is what we do now.

@boydaihungst
Copy link
Contributor Author

Yup. But the current method doesn't works with asdf.

@Uzaaft
Copy link
Member

Uzaaft commented Sep 14, 2025

I dont get how. How doesnt it work with asdf. Whats the error.

Copy link
Member

@Uzaaft Uzaaft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deep dove into the code, yeah this is smarter tbh. Rewrote the command to use the one from the official docs with lazy instrucions

@boydaihungst
Copy link
Contributor Author

Sorry for the slow reply. Here is the error when I run :MarkdownPreview

node:internal/modules/cjs/loader:1413
  throw err;
  ^
Error: Cannot find module 'tslib'
Require stack:
- /home/huyhoang/.local/share/nvim/lazy/markdown-preview.nvim/app/lib/app/index.js
- /home/huyhoang/.local/share/nvim/lazy/markdown-preview.nvim/app/index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1410:15)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1051:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1056:22)
    at Module._load (node:internal/modules/cjs/loader:1219:37)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:238:24)
    at Module.require (node:internal/modules/cjs/loader:1493:12)
    at require (node:internal/modules/helpers:152:16)
    at Object.<anonymous> (/home/huyhoang/.local/share/nvim/lazy/markdown-preview.nvim/app/lib/app/index.js:3:17)
    at Module._compile (node:internal/modules/cjs/loader:1738:14) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/huyhoang/.local/share/nvim/lazy/markdown-preview.nvim/app/lib/app/index.js',
    '/home/huyhoang/.local/share/nvim/lazy/markdown-preview.nvim/app/index.js'
  ]
}
Node.js v24.7.0

@Uzaaft Uzaaft changed the title fix(markdown): use new build command for markdown-preview. fix(markdown): Download prebuilt version of markdown-preview. Sep 14, 2025
@Uzaaft Uzaaft changed the title fix(markdown): Download prebuilt version of markdown-preview. fix(markdown): Change build command to download prebuilt version of markdown-preview. Sep 14, 2025
@Uzaaft Uzaaft changed the title fix(markdown): Change build command to download prebuilt version of markdown-preview. fix(markdown-preview-nvim): Change build command to download prebuilt version of markdown-preview. Sep 14, 2025
@Uzaaft Uzaaft merged commit 5c9c55c into AstroNvim:main Sep 15, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants