stitches icon indicating copy to clipboard operation
stitches copied to clipboard

Error: node_modules/@stitches/react/types"' has no exported member 'createStitches'

Open LucasCaixeta opened this issue 2 years ago • 15 comments

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

image image

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!

LucasCaixeta avatar Oct 06 '21 14:10 LucasCaixeta

Hey, thanks for this. Is this a new error that just happened after upgrading to 1.2.3?

peduarte avatar Oct 06 '21 16:10 peduarte

No, also with 1.1.0 :(

LucasCaixeta avatar Oct 06 '21 17:10 LucasCaixeta

@peduarte I'll revert my package.json to an old version to check if solve the problem. I'll give feedback here after that.

LucasCaixeta avatar Oct 06 '21 17:10 LucasCaixeta

ok, thanks!

peduarte avatar Oct 06 '21 18:10 peduarte

@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

LucasCaixeta avatar Oct 06 '21 20:10 LucasCaixeta

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)

LucasCaixeta avatar Oct 13 '21 11:10 LucasCaixeta

Ok, we haven't had a chance to look into this yet. Im really confused why this only seems to be happening with you.

peduarte avatar Oct 22 '21 10:10 peduarte

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.

LucasCaixeta avatar Oct 25 '21 09:10 LucasCaixeta

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.

rossmoody avatar Dec 11 '21 18:12 rossmoody

Hi, we have the same error when using TSDX + stitches. I didn't find any solution yet..

tomkuehl avatar Apr 17 '22 12:04 tomkuehl

I am also facing the same error when using TSDX + stitches, was anyone able to find a solution for this?

riverrz avatar Aug 14 '22 17:08 riverrz

@peduarte Any progress on this?

jonatassales avatar Oct 06 '22 00:10 jonatassales

i'm not actively involved in this project since the modulz acquisition. hopefully @hadihallak can help though.

peduarte avatar Oct 06 '22 06:10 peduarte

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.

hadihallak avatar Oct 06 '22 15:10 hadihallak

it's works for me also, but I would like to understand why I can use const/require and not import

tgmarinho avatar Nov 26 '22 18:11 tgmarinho