blinkfox / hexo-theme-matery

A beautiful hexo blog theme with material design and responsive design.一个基于材料设计和响应式设计而成的全面、美观的Hexo主题。国内访问:http://blinkfox.com
https://blinkfox.github.io/
Apache License 2.0
5.24k stars 1.25k forks source link

hexo g 和 hexo s 的时候报错 err: TypeError: Prism.languages.typescript.keyword.push is not a function #789

Open Drun1baby opened 2 years ago

Drun1baby commented 2 years ago

前两天在写 python flask 代码的时候,代码行中间使用了 {{xxx}} 的语句 使用这个语句之后无法部署了,后面是修改 node_modules/nunjucks/src/lexer.js 中的文件得以上传。 但是今天再部署的时候发现本地部署都不可以了,报错就是

FATAL {
  err: TypeError: Prism.languages.typescript.keyword.push is not a function
      at C:\Users\VanHurts\OneDrive\myblog\node_modules\prismjs\components\prism-typescript.js:14:37
      at Object.<anonymous> (C:\Users\VanHurts\OneDrive\myblog\node_modules\prismjs\components\prism-typescript.js:60:2)
      at Module._compile (node:internal/modules/cjs/loader:1103:14)
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Module.require (node:internal/modules/cjs/loader:1005:19)
      at require (node:internal/modules/cjs/helpers:102:18)
      at C:\Users\VanHurts\OneDrive\myblog\node_modules\prismjs\components\index.js:45:3
      at handleId (C:\Users\VanHurts\OneDrive\myblog\node_modules\prismjs\dependencies.js:284:6)
      at C:\Users\VanHurts\OneDrive\myblog\node_modules\prismjs\dependencies.js:274:18
      at Array.map (<anonymous>)
      at handleId (C:\Users\VanHurts\OneDrive\myblog\node_modules\prismjs\dependencies.js:273:40)
      at loadComponentsInOrder (C:\Users\VanHurts\OneDrive\myblog\node_modules\prismjs\dependencies.js:293:4)
      at Object.load (C:\Users\VanHurts\OneDrive\myblog\node_modules\prismjs\dependencies.js:439:12)
      at loadLanguages (C:\Users\VanHurts\OneDrive\myblog\node_modules\prismjs\components\index.js:31:43)
      at prismHighlight (C:\Users\VanHurts\OneDrive\myblog\node_modules\hexo-util\lib\prism.js:20:81)
      at PrismUtil (C:\Users\VanHurts\OneDrive\myblog\node_modules\hexo-util\lib\prism.js:103:18)
      at C:\Users\VanHurts\OneDrive\myblog\node_modules\hexo\lib\plugins\filter\before_post_render\backtick_code_block.js:65:17
      at String.replace (<anonymous>)
      at Hexo.backtickCodeBlock (C:\Users\VanHurts\OneDrive\myblog\node_modules\hexo\lib\plugins\filter\before_post_render\backtick_code_block.js:19:30)
      at Hexo.tryCatcher (C:\Users\VanHurts\OneDrive\myblog\node_modules\bluebird\js\release\util.js:16:23)
} Something's wrong. Maybe you can find the solution here: %s https://hexo.io/docs/troubleshooting.html

有没有哪位大哥帮忙看一看啊,尝试过了升级版本,还是无法奏效

Drun1baby commented 2 years ago

目前关掉了 prism 的渲染,问题初步解决,但是如果要开启渲染,该怎么做

tyfhxn commented 2 years ago

https://www.wxnacy.com/2018/01/12/hexo-specific-symbol/ 可以试试将字符进行转义