[vuejs/vuepress]构建报错未定义不是一个函数

2024-02-04 23 views
5
错误报告

长时间没写的项目,资源报如下错误,代码回滚也不管用 Snipaste_2021-01-15_15-39-50

其他相关信息
  • 我的 VuePress 项目中的输出npx vuepress info

回答

7

我也遇到了同样的问题

6

同样的问题,怎么解决呢?

TypeError: undefined is not a function
    at C:\...\node_modules\@vuepress\core\lib\node\build\index.js:82:15    
    at Array.filter (<anonymous>)
    at Build.render (C:\ ....\node_modules\@vuepress\core\lib\node\build\index.js:82:8)
    at async App.build (C:\....\node_modules\@vuepress\core\lib\node\App.js:499:5)
error Command failed with exit code 1.

我只是删除 config.js 中的代码:

  // head: [
  //   'link',
  //   { rel: 'icon', href: '/voerka.png' }
  // ],

但现在它返回新问题:

wait Rendering static HTML...
(node:13224) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'catch' of undefined
    at server-bundle.js:13837:23
(Use `node --trace-warnings ...` to show where the warning was created)
(node:13224) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside 
of an async function without a catch block, or by rejecting a 
promise which was not handled with .catch(). To terminate the 
node process on unhandled promise rejection, use the CLI flag 
`--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)      
(node:13224) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:13224) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'catch' of undefined
    at server-bundle.js:13837:23
(node:13224) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside 
of an async function without a catch block, or by rejecting a 
promise which was not handled with .catch(). To terminate the 
node process on unhandled promise rejection, use the CLI flag 
`--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)      
(node:13224) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'catch' of undefined
    at server-bundle.js:13837:23
(node:13224) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside 
of an async function without a catch block, or by rejecting a 
promise which was not handled with .catch(). To terminate the 
node process on unhandled promise rejection, use the CLI flag 
`--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)      
(node:13224) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'catch' of undefined
    at server-bundle.js:13837:23
(node:13224) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside 
of an async function without a catch block, or by rejecting a 
promise which was not handled with .catch(). To terminate the 
node process on unhandled promise rejection, use the CLI flag 
`--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)      
(node:13224) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'catch' of undefined
    at server-bundle.js:13837:23
(node:13224) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside 
of an async function without a catch block, or by rejecting a 
promise which was not handled with .catch(). To terminate the 
node process on unhandled promise rejection, use the CLI flag 
`--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 5)      
(node:13224) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'catch' of undefined
    at server-bundle.js:13837:23
(node:13224) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside 
of an async function without a catch block, or by rejecting a 
promise which was not handled with .catch(). To terminate the 
node process on unhandled promise rejection, use the CLI flag 
`--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 6)      
(node:13224) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'catch' of undefined
    at server-bundle.js:13837:23
(node:13224) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside 
of an async function without a catch block, or by rejecting a 
promise which was not handled with .catch(). To terminate the 
node process on unhandled promise rejection, use the CLI flag 
`--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 7)      
(node:13224) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'catch' of undefined
    at server-bundle.js:13837:23
(node:13224) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside 
of an async function without a catch block, or by rejecting a 
promise which was not handled with .catch(). To terminate the 
node process on unhandled promise rejection, use the CLI flag 
`--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 8)      
(node:13224) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'catch' of undefined
    at server-bundle.js:13837:23
(node:13224) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside 
of an async function without a catch block, or by rejecting a 
promise which was not handled with .catch(). To terminate the 
node process on unhandled promise rejection, use the CLI flag 
`--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 9)      
(node:13224) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'catch' of undefined
    at server-bundle.js:13837:23
(node:13224) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside 
of an async function without a catch block, or by rejecting a 
promise which was not handled with .catch(). To terminate the 
node process on unhandled promise rejection, use the CLI flag 
`--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 10)     
(node:13224) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'catch' of undefined
    at server-bundle.js:13837:23
(node:13224) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside 
of an async function without a catch block, or by rejecting a 
promise which was not handled with .catch(). To terminate the 
node process on unhandled promise rejection, use the CLI flag 
`--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 11)     
(node:13224) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'catch' of undefined
    at server-bundle.js:13837:23
(node:13224) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside 
of an async function without a catch block, or by rejecting a 
promise which was not handled with .catch(). To terminate the 
node process on unhandled promise rejection, use the CLI flag 
`--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 12)     
(node:13224) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'catch' of undefined
    at server-bundle.js:13837:23
(node:13224) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside 
of an async function without a catch block, or by rejecting a 
promise which was not handled with .catch(). To terminate the 
node process on unhandled promise rejection, use the CLI flag 
`--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 13)     
(node:13224) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'catch' of undefined
    at server-bundle.js:13837:23
(node:13224) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside 
of an async function without a catch block, or by rejecting a 
promise which was not handled with .catch(). To terminate the 
node process on unhandled promise rejection, use the CLI flag 
`--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 14)     
(node:13224) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'catch' of undefined
    at server-bundle.js:13837:23
(node:13224) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside 
of an async function without a catch block, or by rejecting a 
promise which was not handled with .catch(). To terminate the 
node process on unhandled promise rejection, use the CLI flag 
`--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 15)     
(node:13224) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'catch' of undefined
    at server-bundle.js:13837:23
(node:13224) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside 
of an async function without a catch block, or by rejecting a 
promise which was not handled with .catch(). To terminate the 
node process on unhandled promise rejection, use the CLI flag 
`--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 16)     
(node:13224) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'catch' of undefined
    at server-bundle.js:13837:23
(node:13224) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside 
of an async function without a catch block, or by rejecting a 
promise which was not handled with .catch(). To terminate the 
node process on unhandled promise rejection, use the CLI flag 
`--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 17)     
(node:13224) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'catch' of undefined
    at server-bundle.js:13837:23
(node:13224) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside 
of an async function without a catch block, or by rejecting a 
promise which was not handled with .catch(). To terminate the 
node process on unhandled promise rejection, use the CLI flag 
`--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 18)     
(node:13224) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'catch' of undefined
    at server-bundle.js:13837:23
(node:13224) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside 
of an async function without a catch block, or by rejecting a 
promise which was not handled with .catch(). To terminate the 
node process on unhandled promise rejection, use the CLI flag 
`--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 19)     
(node:13224) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'catch' of undefined
    at server-bundle.js:13837:23
(node:13224) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside 
of an async function without a catch block, or by rejecting a 
promise which was not handled with .catch(). To terminate the 
node process on unhandled promise rejection, use the CLI flag 
`--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 20)     
(node:13224) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'catch' of undefined
    at server-bundle.js:13837:23
(node:13224) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside 
of an async function without a catch block, or by rejecting a 
promise which was not handled with .catch(). To terminate the 
node process on unhandled promise rejection, use the CLI flag 
`--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 21)     
(node:13224) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'catch' of undefined
    at server-bundle.js:13837:23
(node:13224) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside 
of an async function without a catch block, or by rejecting a 
promise which was not handled with .catch(). To terminate the 
node process on unhandled promise rejection, use the CLI flag 
`--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 22)     
(node:13224) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'catch' of undefined
    at server-bundle.js:13837:23
(node:13224) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside 
of an async function without a catch block, or by rejecting a 
promise which was not handled with .catch(). To terminate the 
node process on unhandled promise rejection, use the CLI flag 
`--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 23)     
Done in 14.81s.