Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@nuxt/ui causes typecheck errors #2532

Closed
some-user123 opened this issue Nov 5, 2024 · 6 comments
Closed

@nuxt/ui causes typecheck errors #2532

some-user123 opened this issue Nov 5, 2024 · 6 comments
Labels
bug Something isn't working v3 #1289

Comments

@some-user123
Copy link

Environment


  • Operating System: Windows_NT
  • Node Version: v20.11.1
  • Nuxt Version: 3.14.0
  • CLI Version: 3.15.0
  • Nitro Version: 2.10.2
  • Package Manager: [email protected]
  • Builder: -
  • User Config: default
  • Runtime Modules: @nuxt/[email protected]
  • Build Modules: -

Version

v3.0.0-alpha7

Reproduction

https://github.com/some-user123/nuxt-ui-3-typeerrors

Description

  • Installed nuxt
  • Installed and configured @nuxt/ui
  • Installed typescript/vue-tsc
  • Run npx nuxi typecheck

Expected: no errors

Actually: 43 errors

node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected]_ro_35j6ordoxzpobrjc25wghh2zvq/node_modules/@nuxt/ui/dist/runtime/components/Accordion.vue:6:24 - error TS2307: Cannot find module '#build/app.config' or its corresponding type declarations.

6 import _appConfig from '#build/app.config'
                         ~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected]_ro_35j6ordoxzpobrjc25wghh2zvq/node_modules/@nuxt/ui/dist/runtime/components/Alert.vue:4:24 - error TS2307: Cannot find module '#build/app.config' or its corresponding type declarations.

4 import _appConfig from '#build/app.config'
                         ~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected]_ro_35j6ordoxzpobrjc25wghh2zvq/node_modules/@nuxt/ui/dist/runtime/components/Avatar.vue:5:24 - error TS2307: Cannot find module '#build/app.config' or its corresponding type declarations.

5 import _appConfig from '#build/app.config'
                         ~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected]_ro_35j6ordoxzpobrjc25wghh2zvq/node_modules/@nuxt/ui/dist/runtime/components/AvatarGroup.vue:4:24 - error TS2307: Cannot find module '#build/app.config' or its corresponding type declarations.

4 import _appConfig from '#build/app.config'
                         ~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected]_ro_35j6ordoxzpobrjc25wghh2zvq/node_modules/@nuxt/ui/dist/runtime/components/Badge.vue:4:24 - error TS2307: Cannot find module '#build/app.config' or its corresponding type declarations.

4 import _appConfig from '#build/app.config'
                         ~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected]_ro_35j6ordoxzpobrjc25wghh2zvq/node_modules/@nuxt/ui/dist/runtime/components/Breadcrumb.vue:5:24 - error TS2307: Cannot find module '#build/app.config' or its corresponding type declarations.

5 import _appConfig from '#build/app.config'
                         ~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected]_ro_35j6ordoxzpobrjc25wghh2zvq/node_modules/@nuxt/ui/dist/runtime/components/Button.vue:4:24 - error TS2307: Cannot find module '#build/app.config' or its corresponding type declarations.

4 import _appConfig from '#build/app.config'
                         ~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected]_ro_35j6ordoxzpobrjc25wghh2zvq/node_modules/@nuxt/ui/dist/runtime/components/ButtonGroup.vue:4:24 - error TS2307: Cannot find module '#build/app.config' or its corresponding type declarations.

4 import _appConfig from '#build/app.config'
                         ~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected]_ro_35j6ordoxzpobrjc25wghh2zvq/node_modules/@nuxt/ui/dist/runtime/components/Card.vue:4:24 - error TS2307: Cannot find module '#build/app.config' or its corresponding type declarations.

4 import _appConfig from '#build/app.config'
                         ~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@[email protected][email protected][email protected][email protected][email protected]_ro_35j6ordoxzpobrjc25wghh2zvq/node_modules/@nuxt/ui/dist/runtime/components/Carousel.vue:12:24 - error TS2307: Cannot find module '#build/app.config' or its corresponding type declarations.

12 import _appConfig from '#build/app.config'
                          ~~~~~~~~~~~~~~~~~~~
...

Additional context

No response

Logs

No response

@some-user123 some-user123 added bug Something isn't working triage v3 #1289 labels Nov 5, 2024
@benjamincanac benjamincanac removed the triage label Nov 5, 2024 — with Volta.net
This was referenced Nov 5, 2024
@zugende
Copy link

zugende commented Nov 5, 2024

For some additional context, I'm currently using nuxt/ui [v3] in a non-Nuxt project. Everything functions as expected during development, but I encounter the same type errors during the build process. I've included my package.json below in case that helps pinpoint the issue.

I'm aware that this is still an alpha release, v3 looks fantastic, and I'm eager to incorporate it into my projects fully! Great work Benjamin! ⭐️

{
{
  "name": "nuxt-test",
   ...
  },
  "dependencies": {
    "@nuxt/ui": "https://pkg.pr.new/@nuxt/ui@5a9511f",
    "@unhead/vue": "^1.11.11",
    "pinia": "^2.2.4",
    "prism-code-editor": "^3.4.0",
    "tailwindcss": "4.0.0-alpha.31",
    "vue": "^3.5.12",
    "vue-color-input": "^2.0.0",
    "vue-router": "^4.4.5",
    "zod": "^3.23.8"
  },
  "devDependencies": {
    "@tsconfig/node20": "^20.1.4",
    "@types/node": "^20.17.0",
    "@vitejs/plugin-vue": "^5.1.4",
    "@vue/tsconfig": "^0.5.1",
    "npm-run-all2": "^7.0.1",
    "typescript": "~5.6.0",
    "vite": "^5.4.10",
    "vite-plugin-vue-devtools": "^7.5.3",
    "vue-tsc": "^2.1.6"
  }
}

benjamincanac added a commit that referenced this issue Nov 6, 2024
@some-user123
Copy link
Author

After updating to

 "dependencies": {
    "@nuxt/ui": "https://pkg.pr.new/@nuxt/ui@12ae20d",

I still getting similar errors :-/

node_modules/.pnpm/@nuxt+ui@https+++pkg.pr.new+@nuxt+ui@12ae20d_@[email protected][email protected]_embla-car_b3ryeuhcgrql36yiokzj7bicru/node_modules/@nuxt/ui/dist/runtime/components/Accordion.vue:5:24 - error TS2307: Cannot find module '#build/app.config' or its corresponding type declarations.

5 import _appConfig from '#build/app.config'
                         ~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@nuxt+ui@https+++pkg.pr.new+@nuxt+ui@12ae20d_@[email protected][email protected]_embla-car_b3ryeuhcgrql36yiokzj7bicru/node_modules/@nuxt/ui/dist/runtime/components/Alert.vue:4:24 - error TS2307: Cannot find module '#build/app.config' or its corresponding type declarations.

4 import _appConfig from '#build/app.config'
                         ~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@nuxt+ui@https+++pkg.pr.new+@nuxt+ui@12ae20d_@[email protected][email protected]_embla-car_b3ryeuhcgrql36yiokzj7bicru/node_modules/@nuxt/ui/dist/runtime/components/Avatar.vue:6:24 - error TS2307: Cannot find module '#build/app.config' or its corresponding type declarations.

6 import _appConfig from '#build/app.config'
                         ~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@nuxt+ui@https+++pkg.pr.new+@nuxt+ui@12ae20d_@[email protected][email protected]_embla-car_b3ryeuhcgrql36yiokzj7bicru/node_modules/@nuxt/ui/dist/runtime/components/AvatarGroup.vue:4:24 - error TS2307: Cannot find module '#build/app.config' or its corresponding type declarations.

4 import _appConfig from '#build/app.config'
                         ~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@nuxt+ui@https+++pkg.pr.new+@nuxt+ui@12ae20d_@[email protected][email protected]_embla-car_b3ryeuhcgrql36yiokzj7bicru/node_modules/@nuxt/ui/dist/runtime/components/Badge.vue:4:24 - error TS2307: Cannot find module '#build/app.config' or its corresponding type declarations.

4 import _appConfig from '#build/app.config'
                         ~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@nuxt+ui@https+++pkg.pr.new+@nuxt+ui@12ae20d_@[email protected][email protected]_embla-car_b3ryeuhcgrql36yiokzj7bicru/node_modules/@nuxt/ui/dist/runtime/components/Breadcrumb.vue:4:24 - error TS2307: Cannot find module '#build/app.config' or its corresponding type declarations.

4 import _appConfig from '#build/app.config'
                         ~~~~~~~~~~~~~~~~~~~

...

@zugende
Copy link

zugende commented Nov 7, 2024

I can confirm that the new release v3.0.0-alpha.8 still has the errors. I tried manually adding app.config.d.ts to [...]/node_modules/@nuxt/ui/.nuxt/app.config.d.ts but still have not a fully understanding why it sill complains. @benjamincanac any help would be much appreciated. 😇

[more than 100 errors when running pnpm build]

│ 5 import _appConfig from '#build/app.config'~~~~~~~~~~~~~~~~~~~
│
│ ../../node_modules/.pnpm/@[email protected]_@[email protected]_chang
│ [email protected][email protected][email protected]_fexugszcr4lg775go7ekwgqtk4/no
│ de_modules/@nuxt/ui/dist/runtime/components/Toast.vue:65:30 - error TS2307
│ : Cannot find module '#imports' or its corresponding type declarations.
│
│ 65 import { useAppConfig } from '#imports'~~~~~~~~~~
│
│ ../../node_modules/.pnpm/@[email protected]_@[email protected]_chang
│ [email protected][email protected][email protected]_fexugszcr4lg775go7ekwgqtk4/no
│ de_modules/@nuxt/ui/dist/runtime/components/Toaster.vue:5:24 - error TS230
│ 7: Cannot find module '#build/app.config' or its corresponding type declar
│ ations.
│
│ 5 import _appConfig from '#build/app.config'~~~~~~~~~~~~~~~~~~~
│
│ ../../node_modules/.pnpm/@[email protected]_@[email protected]_chang
│ [email protected][email protected][email protected]_fexugszcr4lg775go7ekwgqtk4/no
│ de_modules/@nuxt/ui/dist/runtime/components/Tooltip.vue:5:24 - error TS230
│ 7: Cannot find module '#build/app.config' or its corresponding type declar
│ ations.
│
│ 5 import _appConfig from '#build/app.config'

Copy link
Member

benjamincanac commented Nov 7, 2024

I don't understand, I tried it right after the release and everything works. Would you mind sharing a reproduction?

@zugende
Copy link

zugende commented Nov 7, 2024

@benjamincanac Here the reproduction: https://github.com/zugende/nuxt-ui-type-error-repro
Just pnpm dev works perfectly. When pnpm build is triggered you can see the type errors in the terminal.

Edit: Forgot to mention. I am using pnpm create vue@latestto create the vue project and then followed the instructions here: https://ui3.nuxt.dev/getting-started/installation/vue

Copy link
Member

@zugende I see it's with the Vite plugin not Nuxt, would you mind creating a new issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v3 #1289
Projects
None yet
Development

No branches or pull requests

3 participants