gaearon / gitbook-plugin-prism

Gitbook plugin for Prism highlighting
Apache License 2.0
88 stars 26 forks source link

prism warnings & Failed to load prism syntax: text error #26

Closed didi0613 closed 7 years ago

didi0613 commented 7 years ago
warn: "options" property is deprecated, use config.get(key) instead
warn: "options.generator" property is deprecated, use "output.name" instead
Failed to load prism syntax: text
{ Error: Cannot find module 'prismjs/components/prism-text.js'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at requireSyntax (/Users/s0d00px/electrode/node_modules/gitbook-plugin-prism/index.js:31:3)

    at Object.code (/Users/s0d00px/electrode/node_modules/gitbook-plugin-prism/index.js:97:11)
    at Record.TemplateBlock.applyBlock (/Users/s0d00px/.gitbook/versions/3.2.2/lib/models/templateBlock.js:205:23)
    at /Users/s0d00px/.gitbook/versions/3.2.2/lib/output/getModifiers.js:56:33
    at /Users/s0d00px/.gitbook/versions/3.2.2/lib/output/modifiers/highlightCode.js:47:24
    at /Users/s0d00px/.gitbook/versions/3.2.2/lib/output/modifiers/editHTMLElement.js:11:16 code: 'MODULE_NOT_FOUND'
}
robmcguinness commented 7 years ago

Can you tell me which version of gitbook-plugin-prism and gitbook cli you are using?

robmcguinness commented 7 years ago
Cannot find module 'prismjs/components/prism-text.js'

This error typically means that you are trying to load up a syntax that is not supported my Prism.js. Check if you are trying to render something within a code block with syntax text. Instead, use one of the supported types: https://github.com/PrismJS/prism/tree/gh-pages/components

robmcguinness commented 7 years ago

Please reopen if my analysis of the bug was incorrect.

didi0613 commented 7 years ago

@robmcguinness Problem Solved. Thank You.