Babel.js 错误:意外的“!”,使用\转义特殊字符可能会有帮助,-预处理生成失败,没有位置

6jjcrrmo  于 2022-12-08  发布在  Babel
关注(0)|答案(1)|浏览(157)

错误:意外的“!”。使用\转义特殊字符可能会有帮助。-预处理生成失败,没有位置

additional chunk assets processing之后,Preact生产构建失败,未给出任何错误位置

  • 毕竟手动'!'似乎是我现在唯一能想到的方法!*

非易失性存储器12.18.3
Ubuntu 20.04语言

npm run build

> cdms-app@0.0.1 build /home/technative/Documents/Projects/CrystalDevDocker/cdms-app
> preact build --no-prerender --dest public --esm --analyze --verbose

⚠ WARN Could not find sw.js in /home/technative/Documents/Projects/CrystalDevDocker/cdms-app/src. Using the default service worker.
⚠ WARN /home/technative/Documents/Projects/CrystalDevDocker/cdms-app/prerender-urls.json doesn't exist, using default!
Uh oh AssertionError [ERR_ASSERTION]: Unable to find a place to inject the manifest. Please ensure that your service worker file contains the following:/(\.precacheAndRoute\()\s*\[\s*\]\s*(\)|,)/
   at Object._callee$ (/home/technative/Documents/Projects/CrystalDevDocker/cdms-app/node_modules/workbox-build/build/entry-points/inject-manifest.js:82:13)
   at tryCatch (/home/technative/Documents/Projects/CrystalDevDocker/cdms-app/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:62:40)
   at Generator.invoke [as _invoke] (/home/technative/Documents/Projects/CrystalDevDocker/cdms-app/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:296:22)
   at Generator.prototype.<computed> [as next] (/home/technative/Documents/Projects/CrystalDevDocker/cdms-app/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:114:21)
   at step (/home/technative/Documents/Projects/CrystalDevDocker/cdms-app/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
   at /home/technative/Documents/Projects/CrystalDevDocker/cdms-app/node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13 {
 generatedMessage: false,
 code: 'ERR_ASSERTION',
 actual: null,
 expected: true,
 operator: '=='
}
Build  [=     ] 10% (1.4s) buildingNodent: Warning - noNodentExtensions option requires acorn >=v4.x. Extensions installed.
Build  [=     ] 12% (7.4s) building[BABEL] Note: The code generator has deoptimised the styling of /home/technative/Documents/Projects/CrystalDevDocker/cdms-app/src/components/createvisitmodal/index.js as it exceeds the max of 500KB.
Build  [=   ] 15% (171.5s) building[BABEL] Note: The code generator has deoptimised the styling of /home/technative/Documents/Projects/CrystalDevDocker/cdms-app/src/routes/siloAdministration/index.js as it exceeds the max of 500KB.
Build  [=   ] 15% (271.8s) building[BABEL] Note: The code generator has deoptimised the styling of /home/technative/Documents/Projects/CrystalDevDocker/cdms-app/src/routes/caseDetail/index.js as it exceeds the max of 500KB.
Build  [=   ] 17% (289.7s) building[BABEL] Note: The code generator has deoptimised the styling of /home/technative/Documents/Projects/CrystalDevDocker/cdms-app/node_modules/pdfmake/build/vfs_fonts.js as it exceeds the max of 500KB.
Build  [==  ] 40% (289.8s) building[BABEL] Note: The code generator has deoptimised the styling of /home/technative/Documents/Projects/CrystalDevDocker/cdms-app/node_modules/pdfmake/build/pdfmake.js as it exceeds the max of 500KB.
Build  [==  ] 40% (377.0s) building[BABEL] Note: The code generator has deoptimised the styling of /home/technative/Documents/Projects/CrystalDevDocker/cdms-app/src/components/semiDetailView/index.js as it exceeds the max of 500KB.
Build  [====] 90% (487.8s) additional chunk assets processing[BABEL] Note: The code generator has deoptimised the styling of /home/technative/Documents/Projects/CrystalDevDocker/cdms-app/src/components/createvisitmodal/index.js as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /home/technative/Documents/Projects/CrystalDevDocker/cdms-app/src/routes/siloAdministration/index.js as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /home/technative/Documents/Projects/CrystalDevDocker/cdms-app/src/routes/caseDetail/index.js as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /home/technative/Documents/Projects/CrystalDevDocker/cdms-app/node_modules/pdfmake/build/pdfmake.js as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /home/technative/Documents/Projects/CrystalDevDocker/cdms-app/node_modules/pdfmake/build/vfs_fonts.js as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /home/technative/Documents/Projects/CrystalDevDocker/cdms-app/src/components/semiDetailView/index.js as it exceeds the max of 500KB.

Build failed! 

Error: Unexpected '!'. Escaping special characters with \ may help.
daupos2t

daupos2t1#

  • 毕竟手动'!'似乎是我现在唯一能想到的方法!*

相关问题