whitespace-se / storybook-addon-html

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

ERR! Module not found: Error: Can't resolve 'prettier/standalone' in '/node_modules/@whitespace/storybook-addon-html/dist/esm' #95

Closed dekisha closed 6 months ago

dekisha commented 1 year ago

Hi there! I've started getting this error with the latest version of "@whitespace/storybook-addon-html": "^5.1.1",

Can someone assist please? Do I need to add another dependency for it?

Thanks!

jeanfredrik commented 1 year ago

Hi dekisha, Did you install Prettier as well? See the Getting started section in the readme.

dekisha commented 1 year ago

Hi jeanfredrik, Yes, I have prettier package installed but is version 1.19.1. I'll try updating it to latest version and see if this error goes away. Will get back to you soon.

joz-cti commented 1 year ago

I have updated prettier to 2.8.4 and I still get the following error when running npm install

ERR! ModuleNotFoundError: Module not found: Error: Can't resolve 'react-syntax-highlighter/dist/esm/styles/hljs/github-gist'

The only way to get past this error is by removing "@whitespace/storybook-addon-html": "^5.0.0", from package.json

If it helps I am on OSX, m1 mac.

jeanfredrik commented 1 year ago

@joz-cti Did you also add react-syntax-highlighter as a dependency?

joz-cti commented 1 year ago

Yup, I had to add it on package.json manually. Any reason why it's not added as a dependency on this package?

jeanfredrik commented 1 year ago

Seems like the theme github-gist was removed in favor of github in highlight.js v11.0.0. Should be fixed in v5.1.3 now.

joz-cti commented 1 year ago

Thank you @jeanfredrik