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

What did debug 4 introduce to make babel fails to polyfill IE 11? #729

Closed
qiulang opened this issue Nov 13, 2019 · 5 comments
Closed

What did debug 4 introduce to make babel fails to polyfill IE 11? #729

qiulang opened this issue Nov 13, 2019 · 5 comments

Comments

@qiulang
Copy link

qiulang commented Nov 13, 2019

Hi,
This is a question.
So when I use version 3 I can use @babel/preset-env to polyfill IE 11.
But if I use version 4 polyfill fails for IE 11 I got SCRIPT1002

SCRIPT1002: Syntax error
chunk-vendors.js (25052,40) //which point to 

/**
 * Colorize log arguments if enabled.
 *
 * @api public
 */

args[0].replace(/%[a-zA-Z%]/g, match => {
		if (match === '%%') {
			return;
		}
		index++;

I try all the ways I can think of to polyfill version 4 but I still get this error.

@Qix-
Copy link
Member

Qix- commented Nov 13, 2019

There's not enough information here to help you. This sounds like a Babel configuration problem, and that's not a typical Javascript syntax error that I've seen (plus it doesn't really say what the syntax error is).

@qiulang
Copy link
Author

qiulang commented Nov 13, 2019

My babel config is rather simple

'@babel/preset-env',
{
	debug: true,
	targets: {
		chrome: '68',
		ie: '11',
		edge: '17',
		firefox: '68'
	},
	useBuiltIns: 'usage',
	corejs: 3
}

From here socketio/socket.io-client#1328 (comment)
it said

This happened after updating debug from v3 to v4 which uses spread operator in its distributable.
Very often node_modules are excluded from babel compilation for performance reasons.

I have tried to let babel polyfill & transpile v4 but without success. So I am asking for help.

@Qix-
Copy link
Member

Qix- commented Nov 13, 2019

This isn't really the place to ask for Babel help, sorry. Our package doesn't do anything other packages don't do.

Try asking in the Babel slack channel, or opening an issue with babel (I don't know their support policies so please be mindful of them). I do not use Babel, therefore I cannot help you.

@Qix- Qix- closed this as completed Nov 13, 2019
@qiulang
Copy link
Author

qiulang commented Nov 19, 2019

I raised the issue to babel, according to them babel/babel#10707 (comment)

The error ReferenceError: exports is not defined is thrown from https://github.com/visionmedia/debug/blob/608fca962b34e2bda841db9a4416bab6b4a62803/src/browser.js#L7, which should be considered a bug of debug because browser does not ship CommonJS exports.

@Qix-
Copy link
Member

Qix- commented Nov 19, 2019

Please see babel/babel#10707 (comment) for my response.

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

No branches or pull requests

2 participants