Closed bebbi closed 1 year ago
Here's a potential fix - have a read of that thread. I've seen this before, usually the fix is to adjust the webpack config to avoid including those node variables.
Sorry for the late answer @ben-rogerson . I'm not sure this applies to the situation at hand: To run storybook, I don't have a problem.
The problem comes when building the code as a module using
NODE_ENV=production babel --extensions '.js,.jsx,.ts,.tsx' --source-maps --out-dir dist src
and then importing that module as a dependency in a (gatsby) project.
Maybe I am missing something I should try?
Have you tried setting the build targets? Sounds like its building for node by including the fs node helper.
Sorry I have dropped twin for plain tailwind in that project in question and can't repro, I hope someone else can jump in!
It will be here when they search š
To bootstrap a library of visual components, I have
https://github.com/ben-rogerson/twin.examples/tree/master/storybook-emotion
src/index.js
file that merely re-exports the functions insideButton
andLogo
.Finally I've run
yarn build
(yarn 3.2.3) and tried to import the resulting library in another workspace:Instead of a Button. I get errors such as: "Module not found: Error: Can't resolve 'fs'" (same with
os
,path
).Is this an issue with the example or am I missing something?