stitches
stitches copied to clipboard
Error: node_modules/@stitches/react/types"' has no exported member 'createStitches'
Bug report
Describe the bug
Error when we do: rm -rf node_modules package-lock.json && npm i --force && npm run build (we use TSDX)
Screenshots
System information
- OS: Mac
- Version of Stitches: 1.2.3
- Version of Node.js: v14.17.0
Additional context
Our Design System with Storybook
Thanks in advance for all help!
Hey, thanks for this. Is this a new error that just happened after upgrading to 1.2.3
?
No, also with 1.1.0
:(
@peduarte I'll revert my package.json to an old version to check if solve the problem. I'll give feedback here after that.
ok, thanks!
@peduarte It's strange, I moved back to old branches and this error keeps showing when I do npm run build :( almost without more ideas to try
I tested from the version 1.0.0, after delete node_modules + package-lock.json and do npm i --force I have these errors in the build (npm run build)
Ok, we haven't had a chance to look into this yet. Im really confused why this only seems to be happening with you.
Solved this using require instead of import to use createStitches:
Before: import { createStitches } from '@stitches/react';
Now: const { createStitches } = require('@stitches/react');
Now, after clear node_modules + dist + package-lock.json and do npm i--force + npm run build, we have no errors and the new package-lock is generated successfully.
I noticed this error happened when I destructured the config
object out of createStitches
. If I left config out of destructure the error went away.
Hi, we have the same error when using TSDX + stitches. I didn't find any solution yet..
I am also facing the same error when using TSDX + stitches, was anyone able to find a solution for this?
@peduarte Any progress on this?
i'm not actively involved in this project since the modulz acquisition. hopefully @hadihallak can help though.
I've never used TSDX so sadly we can't prioritise debugging this since it's a build-tool specific issue that might not even originate from stitches. Having said that, I'm happy to help merge a fix for this if a PR was submitted for the same.
it's works for me also, but I would like to understand why I can use const/require and not import