IE11 + webpack 2 + preact/preact-compat
See original GitHub issueAfter 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:
- Created 7 years ago
- Comments:9 (5 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That’s fair enough! Sindresorhus does have very good points in his explanation of why he doesn’t pre-transpile his packages.
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 😃