hexo-theme-matery icon indicating copy to clipboard operation
hexo-theme-matery copied to clipboard

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

Open Drun1baby opened this issue 2 years ago • 2 comments

前两天在写 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 avatar Mar 31 '22 10:03 Drun1baby

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

Drun1baby avatar Apr 01 '22 01:04 Drun1baby

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

tyfhxn avatar Apr 17 '22 12:04 tyfhxn