[英]Javascript code gets "Attempted import error:" in react-scripts build when importing from Typescript file
[英]react-scripts build: Failed to minify the code from this file: opentok.js:1310
使用 npm run build 構建我的 React 項目時,我無法縮小代碼錯誤。
這是導致錯誤的代碼。 誰能建議我能做些什么來解決這個問題?
const createLogger = memoize(namespace => {
/** @type Logger */
const API = {};
const setMethods = () => {
Object.keys(logLevels).forEach(name => {
const method = logLevels[name].method;
const log = debug("OpenTok:" + namespace + ":" + name.toLowerCase());
log.log = console[method].bind(console);
API[name.toLowerCase()] = log;
});
};
setMethods();
return API;
});
我的 package.json
{
"name": "react-basic-video-chat",
"version": "0.1.0",
"private": true,
"dependencies": {
"@opentok/client": "^2.17.0",
"array.prototype.findindex": "^2.1.0",
"opentok-react": "^0.10.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-router-dom": "^5.1.2",
"react-scripts": "1.0.16"
},
"homepage": ".",
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
我的 react-scripts 包已經過時了。 安裝最新版本解決了我的問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.