简体   繁体   English

无法缩小捆绑包。 错误:来自Terser的static / js / main.68c81611.chunk.js

[英]Failed to minify the bundle. Error: static/js/main.68c81611.chunk.js from Terser

I get this error, when i run 我跑的时候得到这个错误

npm run deploy

on my react project. 在我的反应项目上。 So far i have not added any external dependencies, except the gh-pages module. 到目前为止,我没有添加任何外部依赖项,除了gh-pages模块。

package.json file: package.json文件:

  {
  "name": "data-validation",
  "version": "0.1.0",
  "private": true,
  "homepage": "https://kristoffertolboll2.github.io/react-js-data-validation/",
  "dependencies": {
    "gh-pages": "^2.0.1",
    "react": "^16.7.0",
    "react-dom": "^16.7.0",
    "react-scripts": "2.1.3"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "predeploy": "npm run build",
    "deploy": "gh-pages -d build",
    "eject": "react-scripts eject"
  },
  "browserslist": [
    ">0.2%",
    "not dead",
    "not ie <= 11",
    "not op_mini all"
  ]
}

here is the error message i get 这是我得到的错误消息

Failed to minify the bundle. Error: static/js/main.68c81611.chunk.js from Terser
//long stacktrace




npm ERR! code ELIFECYCLE

npm ERR! errno 1
npm ERR! data-validation@0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the data-validation@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Kristoffer\AppData\Roaming\npm-cache\_logs\2019-02-02T22_38_15_532Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! data-validation@0.1.0 predeploy: `npm run build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the data-validation@0.1.0 predeploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Kristoffer\AppData\Roaming\npm-cache\_logs\2019-02-02T22_38_15_570Z-debug.log

i tried deleting the node_modules folder and doing an 我尝试删除node_modules文件夹并执行

npm install 

but the same issue occurs it appears it may be an old dependency? 但同样的问题出现它可能是一个旧的依赖?

For yarn users: add the following field to package.json and then rerun 对于纱线用户:将以下字段添加到package.json,然后重新运行

"resolutions": {
  "terser": "3.14.1"
}

If npm

run npm iterser@3.14

这似乎是当前版本的terser(3.16)的问题,到现在为止,您应该在package.json中将版本设置为3.14.1,如下所示: "terser": "3.14.1",

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 webpack 编译时来自 Terser 的 main.js 中的错误 - ERROR in main.js from Terser when compiling with webpack React Native:“构建 JavaScript 包失败。 无法从“App.js”解析“@react-navigation/stack” - React native: “Failed building JavaScript bundle. Unable to resolve ”@react-navigation/stack“ from ”App.js“” Webpack错误:“块主[entry] bundle.js中的错误,这不是类型化数组。” - Webpack error: “ERROR in chunk main [entry] bundle.js this is not a typed array.” 构建 JavaScript 包失败。 无法读取反应本机模块 traverseDependencies.js 上未定义的属性“减少” - Failed building JavaScript bundle. Cannot read property 'reduce' of undefined on react native module traverseDependencies.js babel-minify vs terser(相反uglify-js) - babel-minify vs terser (instead uglify-js) 从 Next js 主包中移除一个 js 数组 - Remove a js array from the Next js main bundle 错误:加载块0失败。 - webpack尝试加载0.js - Error: Loading chunk 0 failed. - webpack tries to load 0.js 如何在bundle中排除js文件并在另一个chunk / bundle中使用它? - how to exclude js file in bundle and use it in a different chunk/bundle instead? 来自 UglifyJs 的 bundle.js 中的错误 - ERROR in bundle.js from UglifyJs react-scripts build:无法缩小此文件中的代码:opentok.js:1310 - react-scripts build: Failed to minify the code from this file: opentok.js:1310
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM