viktorbonino / radix-themes-tw

MIT License
173 stars 8 forks source link

Typescript complains it can't find the type definitions #6

Closed mikey0000 closed 1 year ago

mikey0000 commented 1 year ago

TS2307: Cannot find module  radix-themes-tw  or its corresponding type declarations.

typescript 5.2.2

viktorbonino commented 1 year ago

Can you give me more details? Are you sure that everything is installed correctly?

mikey0000 commented 1 year ago

its a nextjs project with the following eslintrc

{
  "extends": "next/core-web-vitals",
  "rules": {
    "indent": [
      "error", "tab"
    ]
  },
  "plugins": [
    "import"
  ]
}

tsconfig

{
  "compilerOptions": {
    "target": "es6",
    "lib": [
      "dom",
      "dom.iterable",
      "esnext"
    ],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "incremental": true,
    "typeRoots": [
      "./types"
    ],
    "rootDir": "./",
    "paths": {
      "@/*": [
        "./*"
      ]
    },
    "plugins": [
      {
        "name": "next"
      }
    ]
  },
  "include": [
    "next-env.d.ts",
    "./**/*.ts",
    "./**/*.tsx",
    ".next/types/**/*.ts",
    "dist/types/**/*.ts"
  ],
  "exclude": [
    "node_modules"
  ]
}
mikey0000 commented 1 year ago

all my other imports are fine, its just this one. I'm stumped as to why, intellij can find the type files etc but it always fails on compile/build

jcsmithf22 commented 1 year ago

I have the exact issue, on a fresh typescript install of vite with react. Also, the presets do not seem to be working or showing up in intellisense.

viktorbonino commented 1 year ago

@mikey0000 if you're using ts extension on tailwind config (tailwind.config.ts), you need to have "moduleResolution": "bundler".

viktorbonino commented 1 year ago

@jcsmithf22 can you share your tsconfig and tailwind config?