storybook-addon-html icon indicating copy to clipboard operation
storybook-addon-html copied to clipboard

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

Open dekisha opened this issue 2 years ago • 7 comments

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!

dekisha avatar Feb 08 '23 12:02 dekisha

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

jeanfredrik avatar Feb 12 '23 18:02 jeanfredrik

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.

dekisha avatar Feb 16 '23 13:02 dekisha

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.

joz-cti avatar Mar 10 '23 10:03 joz-cti

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

jeanfredrik avatar Mar 10 '23 14:03 jeanfredrik

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

joz-cti avatar Mar 10 '23 14:03 joz-cti

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.

jeanfredrik avatar Mar 10 '23 15:03 jeanfredrik

Thank you @jeanfredrik

joz-cti avatar Mar 21 '23 11:03 joz-cti