next.js: Examples updated to v3.0.3 don't work in IE 11
I’d like to use the static page export feature of Next.js v3.0.3 however when I test in IE 11, a syntax error in the main.js file kills all JavaScript.
You can reproduce this issue with the following:
git clone https://github.com/zeit/next.js.git
cd next.js/examples/data-fetch
yarn install
yarn add next@3.0.3
yarn run dev
Any advice on how to get Next.js v3 with IE 11 working would be great.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 6
- Comments: 27 (13 by maintainers)
Commits related to this issue
- Downgrade strip-ansi to support IE11/Google Fetch A few discussions: https://github.com/zeit/next.js/issues/2747 https://github.com/zeit/next.js/issues/3126 — committed to i8ramin/next.js by i8ramin 9 years ago
- Downgrade strip-ansi to support IE11/Google Fetch (#3403) A few discussions: https://github.com/zeit/next.js/issues/2747 https://github.com/zeit/next.js/issues/3126 — committed to vercel/next.js by i8ramin 9 years ago
- Downgrade strip-ansi to support IE11/Google Fetch (#3403) A few discussions: https://github.com/zeit/next.js/issues/2747 https://github.com/zeit/next.js/issues/3126 # Conflicts: # package.json — committed to vercel/next.js by i8ramin 9 years ago
Yeah would be nice to re-open this as we just hit it today on Next 4.1.3 (only in dev though).
It was fine yesterday so not sure what happened to trigger this…
v 4.1.0 In IE 11 Error.
Try using
babel: https://github.com/babel/babel-loader/issues/171@timneutkens I believe this is due to https://github.com/zeit/next.js/pull/2325. Probably requires a PR to downgrade
strip-ansisimilar to what was done in https://github.com/facebookincubator/create-react-app/pull/2692, if it doesn’t break anything in order to keep things working in dev for IE11.I’m having the exact same issue, actually had it with “^3.0.1-beta.18” also.
Looks like the Babel + Webpack combo isn’t downgrading the JavaScript in the 2 dependencies chalk/ansi-regex and chalk/strip-ansi which are written using ES6 arrow functions. IE 11 is seeing the following code and throwing a syntax error.
I “think” this is the only section in the
main.jsfile with ES6 code.See the following screenshots:
Thanks for the PR
Most packages by Sindre Sorhus are explicitly for recent Node environments only and not browsers, he closes a lot of issues relating to that as won’t-fix. Babel does not operate on node_modules, Webpack will add any ES6 syntax to the bundle as-is from an npm package.
It would be good to work out why these packages are included in the client bundle.