docsifyjs / docsify

🃏 A magical documentation site generator.
https://docsify.js.org
MIT License
27.15k stars 5.65k forks source link

docsify-server-renderer can't find prismjs #1427

Open davazp opened 3 years ago

davazp commented 3 years ago

Bug Report

When running docsify serve docs/, it fails with the error

Error: Cannot find module 'prismjs'

This can usually work because the docsify package itself depends on it. However, if some other dependency depends on prismjs, the docsify dependency won't be hoist it so docisfy-server-renderer won't find it.

Other relevant information

This can probably be fixed by adding the dependency to the docisyf-server-renderer as well.

Please create a reproducible sandbox

Edit 307qqv236

Mention the docsify version in which this bug was not present (if any)

davazp commented 3 years ago

I worked around this issue temporarily by preventing hoisting for docsify-cli:

    "nohoist": [
      "docsify-cli/**"
    ]
trusktr commented 3 years ago

Adding to #1227 (WIP, it's a mess, will clean it up to separate PRs)