DEV Community

Discussion on: Create a React component library with Vite and Typescript

Collapse
 
cburrows87 profile image
Chris Burrows

Hi, I keep running into the issue of "require undefined"
Image description

This is from a straight pull down from you repository as well as when I do it by hand. Have you encountered this problem before? I have scoured the internet, but can't seem to find a solution :|

Any help would be great!

Collapse
 
nicolaserny profile image
Nicolas Erny

It looks like there is something messy in the node_modules (especially with the alpha version). I've just pushed an update to use fixed dependencies. Now, it should work smoothly with node 16.
For sure, there is work to do if we want to update the dependencies (at the time of the article, only the alpha version was available). I will give it a try when I have more time. Hope it helps.

Collapse
 
nicolaserny profile image
Nicolas Erny

Another idea: if you want to use the latest version of storybook (instead of the alpha versions), you have to use react 18. I remember that I had issues (in another project) with react dom client and React 17. Hope it helps.

Collapse
 
cburrows87 profile image
Chris Burrows

Awesome, I will give it a go! Thanks for the swift reply! I've been trying to just get a component library ready and your approach seemed great! (Once i got it working XD)