Closed jrutila closed 1 month ago
Do you have typescript
installed in your devDependencies
?
Do you have
typescript
installed in yourdevDependencies
?
Yes. In the reproduction script it does that: pnpm add -D typescript
Just tried your script and it is invalid, the pnpm-workspace.yml
looks like this:
-e packages:
- "nuxt-proj"
Also, typescript
doesn't appear in the nuxt-proj/package.json
dev dependencies.
But anyway it works fine on my side. If the issue persists, could you please provide a repository as reproduction? Tailwind CSS v4 is not working on StackBlitz at the moment.
@benjamincanac Since I have just stumbled across the same bug, here is a small repo where the error occurs: https://github.com/DevJoghurt/nuxtui-pnpm-bug
Just clone the repo and run:
pnpm install
pnpm dev
@DevJoghurt You're missing two things in your reproduction:
tsconfig.json
with:{
"extends": "./app/.nuxt/tsconfig.json"
}
postinstall
script in your package.json
with nuxt prepare app
to generate the .app/.nuxt
before running nuxt dev
Here is my reproduction repository https://github.com/jrutila/nuxt-ui-issue-2291. It is a little bit slimmer, even.
@DevJoghurt are you running your project on Windows? Could that have to do something with this, if it works with @benjamincanac.
@jrutila Same as @DevJoghurt reproduction, you're missing a tsconfig.json
at the root of your workspace. This fixes the issue for me.
@benjamincanac yes, just noticed that you meant the root tsconfig.json
. And it indeed fixed it for me, too.
Is it working as intended like that? Or is this just a workaround?
And it works also if the root tsconfig.json
extends the tsconfig.json
from the nuxt app.
{
"extends": "./nuxt-proj/tsconfig.json"
}
@benjamincanac
Ok, thank you. I've got it working now too
As to why we need to do this, it might be a limitation or bug of vue sfc compiler - will need to investigate more!
Environment
Nuxt project info:
Build Modules: -
Version
3.0.0-alpha.4
Reproduction
I don't get to seem the reproduction work in stackblitz, so here's a
setup.sh
that will demonstrate the problem.Description
When
@nuxt/ui
3 is used in a pnpm workspace project, therun dev
fails on error: "Pre-transform error: [@vue/compiler-sfc] Failed to resolve extends base type."When the workspace is removed (remove
pnpm-workspace.yaml
and runpnpm install
in the project folder) the run works. Havingtypescript
indevDependencies
(as said in https://github.com/nuxt/ui/issues/1289#issuecomment-2345702060) does not help.Additional context
No response
Logs