-
Notifications
You must be signed in to change notification settings - Fork 108
Cyclic TS errors with hub:db after nuxt prepare (db types and path aliases) #796
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Hello,
After installing @nuxthub/core 0.10.5 there's a confusing cycle of TypeScript errors that keeps alternating between two different problems depending on which command you run.
Steps to reproduce
Steps to reproduce the behavior:
- Clone: https://github.com/Yizack/nuxthub-reproduction
- Fresh install, run
pnpm i(which runs prepare) →vue-tsc -b --noEmit- ❌
dbauto-import has no types - ❌ Non-relative path errors in
.nuxt/tsconfig.app.jsonand.nuxt/tsconfig.shared.json:
- ❌
- Run
pnpm devwait, stop it, then runvue-tsc -b --noEmitagain- ✅
dbis now typed correctly - ❌ Non-relative path errors still present
- ✅
- Run
pnpm postinstall(which runs prepare) again →vue-tsc -b --noEmit- ❌
dbloses its types again - ✅ Non-relative path errors disappear
- ❌
Edit: I just saw a similar issue #792 I wonder if it fixed the issue with this commit #795 but just opening this issue to check
Example of Logs
Step 2
npx vue-tsc -b --noEmit
.nuxt/tsconfig.app.json:101:9 - error TS5090: Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?
101 "@nuxthub/db"
you forget a leading './'?
116 "@nuxthub/db/schema"
~~~~~~~~~~~~~~~~~~~~
server/api/users.get.ts:4:21 - error TS7006: Parameter 'user' implicitly has an 'any' type.
4 return users.map((user) => ({
~~~~
.nuxt/tsconfig.shared.json:101:9 - error TS5090: Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?
101 "@nuxthub/db"
~~~~~~~~~~~~~
.nuxt/tsconfig.shared.json:116:9 - error TS5090: Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?
116 "@nuxthub/db/schema"
~~~~~~~~~~~~~~~~~~~~
Found 5 errors.
Step 3
npx vue-tsc -b --noEmit
.nuxt/tsconfig.app.json:101:9 - error TS5090: Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?
101 "@nuxthub/db"
~~~~~~~~~~~~~
.nuxt/tsconfig.app.json:116:9 - error TS5090: Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?
116 "@nuxthub/db/schema"
~~~~~~~~~~~~~~~~~~~~
.nuxt/tsconfig.shared.json:101:9 - error TS5090: Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?
101 "@nuxthub/db"
~~~~~~~~~~~~~
.nuxt/tsconfig.shared.json:116:9 - error TS5090: Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?
116 "@nuxthub/db/schema"
~~~~~~~~~~~~~~~~~~~~
Found 4 errors.
Step 4
npx vue-tsc -b --noEmit
server/api/users.get.ts:4:21 - error TS7006: Parameter 'user' implicitly has an 'any' type.
4 return users.map((user) => ({
~~~~
server/api/users.get.ts:4:21 - error TS7006: Parameter 'user' implicitly has an 'any' type.
4 return users.map((user) => ({
~~~~
Found 2 errors.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working