I created a new project with create-react-app today. The production build is not running fine on IE11, the console shows following error:
SCRIPT1010: Expected identifier
The line it points to inside my main.js:
{var n=e&&e.__esModule?function(){return e.default}:function(){return e};
The error is after the e.(default) above. My package json is plain:
{
"name": "sample-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.3.1",
"react-dom": "^16.3.1",
"react-scripts": "1.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
Strange enough, my dev server works perfectly on IE11 so issue is only with production build. It works well on Chrome as well. Is that I need to have polyfills?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…