whitespace-se / storybook-addon-html

A Storybook addon that extracts and displays compiled syntax-highlighted HTML
Other
95 stars 43 forks source link

storybook 6.1.10 + ie11 isn't working = highlightjs isnt babel'd #38

Closed dutscher closed 1 year ago

dutscher commented 3 years ago

using the newest: "@whitespace/storybook-addon-html": "^4.2.0", and default storybook babel and webpack config.

And here the main.js addon config: image

This combi will break the IE11: image image class Response isn't ready for es5

here a chrome console output: image

and then i found that highlight.js. this file isn't babel'd yet node_modules/highlight.js/lib/core.js which is required by "react-syntax-highlighter": "^15.4.3". but your https://github.com/whitespace-se/storybook-addon-html/blob/master/addon/.babelrc has exactly the plugin-proposal-class-properties.

what can i do to fix this issue? thanks in advance.

cheers

dutscher commented 3 years ago

its releated to https://github.com/highlightjs/highlight.js/issues/2501 they dropped ie11 support in v10. maybe there is no hope to get this working :)

cheers

jeanfredrik commented 3 years ago

One option would be to downgrade react-syntax-highlighter from 15 to 13. That shouldn’t be problem though because this addon doesn’t rely on any of the features listed as breaking changes in neither Highlight.js or [react-syntax-highlighter]((https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/CHANGELOG.MD).

Right now I can’t get the latest version of Storybook (6.2.9) to work in IE11 at all though because of this issue. When it's solved, we can give this a try.

jeanfredrik commented 1 year ago

From version 5 of this addon react-syntax-highlighter is a peer dependency that you install manually, so downgrading would be easy. I'm not sure if IE11 is still a requirement for you though. I will close this issue for now.