question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IE11 + webpack 2 + preact/preact-compat

See original GitHub issue

After switching to preact-compat/preact I get this error in IE11 making the app unusable (works of course in all other browser vendors):

SCRIPT1028: Expected identifier, string or number
// I get this also if devtool is set to *source-map
SCRIPT5007: Unable to get property 'call' of undefined or null reference 

The latter is specific to webpack 2, I think, at least, it’s webpack 2 that creates the call method. Seems like a module is missing.

The code for the app is split into 4 files: init.js vendor.js common.js and app.js, The first error points to vendor.js i.e. modules from node_modules and points to the last line of this code (rest of code ommitted):

// make react think we're react.
let VNode = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1_preact__["h"])('a', null).constructor;
VNode.prototype.$$typeof = REACT_ELEMENT_TYPE;
VNode.prototype.preactCompatUpgraded = false;
VNode.prototype.preactCompatNormalized = false;

Object.defineProperty(VNode.prototype, 'type', {
    get() { return this.nodeName; },

I am using:

"preact": "^7.2.0",
"preact-compat": "^3.13.1",

NOTE: If I remove the preact-compat alias, and use react, it works.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ephyscommented, Apr 5, 2017

That’s fair enough! Sindresorhus does have very good points in his explanation of why he doesn’t pre-transpile his packages.

0reactions
developitcommented, Apr 5, 2017

Yup - plus I think we’re going to see more and more of that now that Node supports nearly all of ES2015. It’d be a shame to lose Webpack’s original value - being able to use Node modules in the browser. Hopefully some solution catches on 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

webpack 2 doesn't work on IE11? - Stack Overflow
I have a very basic javascript-project that uses webpack (^2.6.0) as a module bundler. There is one dependency as a vendor module, ...
Read more >
Support IE 11 Using Babel and Webpack | by Rameez Aijaz
According to statcounter IE11 is still used by almost 4% of total internet ... 2. Add it as the entry point inside webpack.config.js...
Read more >
IE 11: broken with webpackHotDevClient. · Issue #998 - GitHub
There seems to be an issue with Internet Explorer 11, where it breaks on an arrow function in ansi-styles. I think the requirement...
Read more >
keywords:IE11 - npm search
Stylis plugin that transforms CSS variable into static values for non-supported browsers. stylis · css-in-js · ie11 · css · variables · css-variables...
Read more >
Tutorial for webpack 4 - part 12 - fix for IE11 problem
Install Babel. I install two babel libraries: core and preset-env. And a loader for webpack: babel-loader. npm install --save- ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found