简体   繁体   English

使用 react-monaco-editor 生成构建时出现意外令牌错误

[英]Getting unexpected token error when generating build with react-monaco-editor

Getting following error while executing npm run build :执行npm run build时出现以下错误:

Child extract-text-webpack-plugin ../../node_modules/extract-text-webpack-plugin/dist ../../node_modules/css-loader/index.js??ref--2-1!../../node_modules/monaco-editor/esm/vs/base/browser/ui/keybindingLabel/keybindingLabel.css:
2 modules
Child vs/language/typescript/tsWorker:
 1 asset
  [17] (webpack)/buildin/global.js 509 bytes {0} [built]
  [40] (webpack)/buildin/harmony-module.js 596 bytes {0} [built]
    + 40 hidden modules

ERROR in ts.worker.js from UglifyJs
Unexpected token: name (_isWindows) [ts.worker.js:78,4]

webpack config: webpack 配置:

https://github.com/react-monaco-editor/react-monaco-editor/files/6173508/webpack.zip https://github.com/react-monaco-editor/react-monaco-editor/files/6173508/webpack.zip

Solved the problem by upgrading the webpack to version 4 from version 3. This requires upgradation of multiple plugins also, since many of them deprecated and added internally to webpack configuration通过将 webpack 从版本 3 升级到版本 4 解决了该问题。这还需要升级多个插件,因为其中许多插件已弃用并在内部添加到 webpack 配置

暂无
暂无

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

相关问题 在 StackBlitz 中制作 react-monaco-editor 示例 - Make a sample of react-monaco-editor in StackBlitz 使用 react-monaco-editor 正确消除调用 onChange 以进行更新 - correctly debouncing a call onChange to update using react-monaco-editor 如何使用 react-monaco-editor 实现 Monaco 编辑器的动态大小调整? - How to implement dynamic sizing of Monaco editor using react-monaco-editor? React-Monaco-Editor:找不到由 monaco-editor-webpack-plugin 生成的工人 - React-Monaco-Editor: Not finding workers produced by monaco-editor-webpack-plugin 尽管光标位于行首,但 react-monaco-editor 文本仍会出现在编辑器的中间 - react-monaco-editor text appears in middle of editor despite cursor being at the start of line 使用带有 React 和 Webpacker 的 Monaco Editor 的 regeneratorRuntime 错误 - regeneratorRuntime error using Monaco Editor with React and Webpacker 使用React和Webpack时如何解决“模块构建失败:SyntaxError:意外令牌”错误? - How to fix “Module build failed: SyntaxError: Unexpected token” error when using React and Webpack? npm启动时模块构建失败并出现意外令牌错误-react / webpack - Module Build Failure with Unexpected token error on npm start - react/webpack React-一个简单函数的“错误:模块构建失败:SyntaxError:意外令牌” - React - “Error: Module build failed: SyntaxError: Unexpected token” for a simple function React Setup'npm run build'错误“意外的令牌'b'在18:4” - React Setup 'npm run build' error “unexpected token 'b' at 18:4”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM