Skip to content
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

IE Syntax error on minified code evaluation #928

Open
babel-bot opened this issue Nov 7, 2018 · 6 comments
Open

IE Syntax error on minified code evaluation #928

babel-bot opened this issue Nov 7, 2018 · 6 comments
Labels
bug Confirmed bug

Comments

@babel-bot
Copy link

Original issue submitted by @attatrol in babel/babel#8980

Bug Report

Current Behavior
IE 11.0.14393.0 returns error Syntax error in regular exception when i try to copy the minified code in its console.

Input Code
REPL link

var regexpUnicodeSupport;
function test() { 
try { new RegExp("\uffff", "u"); regexpUnicodeSupport = true; }
  catch(e) {}
}

Expected behavior/code
Successful evaluation.

Babel Configuration
default minify preset used by REPL

Environment
REPL

@zloirock
Copy link
Member

It's also an issue for core-js:
zloirock/core-js#479
babel/babel#9380

@zloirock zloirock added the bug Confirmed bug label Jan 27, 2019
@zloirock zloirock pinned this issue Feb 22, 2019
@vigneshshanmugam vigneshshanmugam unpinned this issue Jun 11, 2019
@LucidityDesign
Copy link

Any updates? I'm still having this problem with:

"@babel/polyfill": "^7.10.4",
"core-js": "^3.6.5",
"next": "^9.3.0",

and

"useBuiltIns": "usage",

@LiquidMusic1
Copy link

LiquidMusic1 commented Aug 26, 2020

I'm also still having this issue. It's happening in the package object-assign when i inspect the quarrelsome code in IE.... or at least that's the comment above the line to which the error is occurring. I have tried to put in es6-object-assign and use its automatic polyfill at the entry point of the application, but it still produces the same issue. I really need to get this fixed so that my app can move on in development.

I'm currently using (package.json):

   "@babel/plugin-proposal-class-properties": "^7.10.4",
    "@babel/plugin-proposal-object-rest-spread": "^7.11.0",
    "@babel/polyfill": "^7.2.5",
    "@types/react": "^16.4.18",
    "@types/react-dom": "^16.0.9",
    "axios": "^0.18.0",
    "babel-runtime": "^6.26.0",
    "clean-webpack-plugin": "^2.0.1",
    "core-js": "^2.5.7",
    "es6-object-assign": "^1.1.0",
    "handlebars": "^4.1.2",
    "handlebars-loader": "^1.7.1",
    "history": "^4.7.2",
    "html-webpack-plugin": "^3.2.0",
    "node-sass": "^4.9.4",
    "npm": "^6.4.1",
    "raf": "^3.4.0",
    "react": "^16.5.2",
    "react-dom": "^16.5.2",
    "react-html-parser": "^2.0.2",
    "react-router-dom": "^4.3.1",
    "react-spinners": "^0.4.8",
    "rest": "^1.3.1",
    "styled-components": "^5.0.0",
    "util": "^0.12.1"

and in my webpack.config.js (just focusing on babel-loader):

             {
                    test: path.join(__dirname, '.'),
                    exclude: /(node_modules)/,
                    use: [{
                        loader: 'babel-loader?optional=runtime',
                        options: {
                            presets: [
                                [
                                    "@babel/preset-env",
                                    {
                                        useBuiltIns: 'entry',
                                        corejs: '2.5.7',
                                        targets: '> 0.25%, not dead'
                                    }
                                ],
                                "@babel/preset-react"
                            ],
                            plugins: [
                                '@babel/plugin-proposal-class-properties',
                                '@babel/plugin-proposal-object-rest-spread'
                            ]
                        }
                    }]
                }

I can provide as much detail as you need to help figure this out.

@kieranbenton
Copy link

Also having this issue with Vite - when configured using "@vitejs/plugin-legacy" as so:

	plugins: [
		...
		legacy({
			targets: ["defaults, ie >= 11"], // include polyfills from core-js for this set of browsers
			additionalLegacyPolyfills: [
				"proxy-polyfill/proxy.min.js", // immer requires this
			]
		})
	],

IE11 will still not load a react based project, resulting in:

Unhandled promise rejection SyntaxError: Syntax error in regular expression

Not found a work around at the moment, and whilst I will probably just drop IE11 support I would prefer not to uncessarily.

@jacob-baehr
Copy link

@kieranbenton I am also having that same issue when using vite and with that plugin. @kieranbenton were you able to resolve this?

@kieranbenton
Copy link

Afraid not, but equally not tried it again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bug
Projects
None yet
Development

No branches or pull requests

6 participants