-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
webpack-dev-server 2.9.1 produces SCRIPT1002: Syntax error in Internet Explorer 10 and below #1143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Please do make sure you're perusing all of the info on the README 😉 https://github.com/webpack/webpack-dev-server#caveats There are also several issues which address this which have enjoyed discussion and have been closed (#1136, #1101, #1104, #1084). Please try the search function on issues before creating another in the future 🔎 |
@shellscape what do you mean by supporting the last two major versions of major browsers? It seems to me IE 10 is within that definition. |
I just encountered this issue with IE 11, but it's also present in my production build, so it might be webpack related. Not webpack-dev-server related. |
Correction. It's neither This SO answer pointed me in the right direction. The correct way to fix this in your
|
I get this error using webpack 4 with no special customisations, no typescript, very simple setup (and using mode correctly for prod and dev builds - both fail). This is on a library that webpack-devserver is loading, not the app itself which also has the same module.exports = [
{
mode: 'development',
output: {
library: 'mockster',
libraryTarget: 'umd',
filename: 'mockster.js',
},
},
{
mode: 'production',
output: {
library: 'mockster',
libraryTarget: 'umd',
filename: 'mockster.min.js',
},
},
]; Using So in summary does anyone know how to fix this? Thanks |
I did have the similar situations. Using babel-polyfill npm package worked for me for IE 9,10 and 11 versions. |
change your webpack.config to this: const path = require('path');
module.exports = {
devtool: "source-map",
entry: ['babel-polyfill', path.resolve(__dirname, './yourjs.js')],
mode: 'production',
output: {
path: __dirname+'/draft.iml.ru/static/main/js/',
filename: 'yout.js'
}
}; You have to to add |
webpack.config.js
Expected Behavior
Run app on IE 10 and 9 without errors
Actual Behavior
The webpack-dev-server 2.9.1 version produces error in Internet Explorer 10 and below:
SCRIPT1002: Syntax error and the line - const url = __webpack_require__(83);
Setting the devtool to:
devtool: 'cheap-eval-source-map'
shows this error:SCRIPT1002: Syntax error - line with eval()
On remoter server -
SCRIPT5009: 'Set' is undefine
Once downgraded to 2.7.1 fixed the error.
But on IE9 the error
SCRIPT5009: 'Set' is undefine
remainsHere is a little bit more information regarding this error:
https://stackoverflow.com/questions/46651499/react-webpack-and-babel-for-internet-explorer-10-and-below-produces-script1002
The text was updated successfully, but these errors were encountered: