[ant-design/ant-design-pro]启动项目,报错,但是控制台并没有定位到具体的错误位置

2024-08-29 581 views
8

有点不知所以然?

(node:14592) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token a in JSON at position 0
    at JSON.parse (<anonymous>)
    at Readable.<anonymous> (D:\workspace\cpdm-2.0\cpdm-ui\cpdm-ui-console\node_modules\hard-source-webpack-plugin\lib\hard-source-append-serializer.js:442:43)
    at emitOne (events.js:116:13)
    at Readable.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Readable.push (_stream_readable.js:208:10)
    at D:\workspace\cpdm-2.0\cpdm-ui\cpdm-ui-console\node_modules\hard-source-webpack-plugin\lib\hard-source-append-serializer.js:231:13
    at <anonymous>
(node:14592) 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(). (rejection id: 1)
(node:14592) [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.

回答

1

看看 issue 很多这个 bug! 删除node_moudle 然后cnpm 安装

0

token文件已经检查过,并无过错

0

@chenshuai2144 好的,我试一下,谢谢

5

@chenshuai2144 解决了,但是我有一点迷惑,我昨晚用的好好的,今早之前我未做过任何事情,怎么就报这个错误了呢?

7

@chenshuai2144 @sorrycc 今天又出现了情况,所以引起这个的原因是什么呢?

(node:18220) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token { in JSON at position 15602
    at JSON.parse (<anonymous>)
    at Readable.<anonymous> (D:\workspace\cpdm-2.0\cpdm-ui\cpdm-ui-console\node_modules\hard-source-webpack-plugin\lib\hard-source-append-serializer.js:442:43)
    at emitOne (events.js:116:13)
    at Readable.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Readable.push (_stream_readable.js:208:10)
    at D:\workspace\cpdm-2.0\cpdm-ui\cpdm-ui-console\node_modules\hard-source-webpack-plugin\lib\hard-source-append-serializer.js:231:13
    at <anonymous>
(node:18220) 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(). (rejection id: 1)
(node:18220) [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.
3

HARD_SOURCE=none roadhog build,下个版本我还是默认关闭这个优化吧。

7

有HARD_SOURCE这个的相关优化文档嘛?

9

@DuduStyle 有没有感觉二次启动快很多?

4

@sorrycc 没有明显感觉,感觉时间差不多。。。