stitchesjs / stitches

[Not Actively Maintained] CSS-in-JS with near-zero runtime, SSR, multi-variant support, and a best-in-class developer experience.
https://stitches.dev
MIT License
7.75k stars 253 forks source link

Exported variable "Variable" has or is using name 'Stitches' from external module #1014

Closed oeduardoal closed 1 year ago

oeduardoal commented 2 years ago

After updating to 1.2.8, I'm getting all kinds of Type errors. https://github.com/modulz/stitches/releases/tag/v1.2.8

 Exported variable 'StyledInput' has or is using name 'Stitches' from external module "/Users/oeduardoal/projects/gb/flora-ds/packages/core/dist/types/flora.config" but cannot be named
image
hadihallak commented 2 years ago

Would you mind creating a repo with the issue? worth trying is to remove node_modules and your lock files

oeduardoal commented 2 years ago

@hadihallak Of course! I'll comment here!

oeduardoal commented 2 years ago

Hey @hadihallak !

https://github.com/oeduardoal/stitches-issue

it's looks like something with Type in "utils":

Github Actions: https://github.com/oeduardoal/stitches-issue/runs/6258791386?check_suite_focus=true

export const designsystem = createStitches({
  prefix: "designsystem-",
  theme: {},
  media: {},
  utils: {
    p: (value: Stitches.PropertyValue<"padding">) => ({
      padding: value,
    }),
  },
});

When not used, the error does not occur

Kinbaum commented 2 years ago

@oeduardoal Try this instead

import { createStitches, ScaleValue } from '@stitches/react';

export const designsystem = createStitches({
  prefix: "designsystem-",
  theme: {},
  media: {},
  utils: {
    p: (value: ScaleValue<'space'> | string | number) => ({
      padding: value
    })
  }
});
jrgarciadev commented 2 years ago

Hi guys 🙌🏻 , any update on this?

gregogun commented 1 year ago

@oeduardoal @jrgarciadev are you guys importing * as Stitches type in your stitches.config.ts file?

removing the type and just importing ScaleValue and/or PropertyValue from @stitches/react solved the issue for me. Hope this might help 👍