trpc / trpc/trpc

bug: Error when removing baseUrl - unstable-core-do-not-import type issue

Open
#6,998 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

🐛 bug: unconfirmed
Dominant language
TypeScript
Stars
40.6k
Forks
1.7k
Avg merge
1d 22h
Merged PRs (30d)
22

Description

Provide environment information

src/middleware/jwt/index.ts:11:14 - error TS2742: The inferred type of 'jwtMiddleware' cannot be named without a reference to '../../../node_modules/@trpc/server/dist/unstable-core-do-not-import.d-1RewV6pM.mjs'. This is likely not portable. A type annotation is necessary.

Describe the bug

Hi there,

I encountered an issue when I removed the baseUrl configuration. After removing baseUrl, I get the following TypeScript error

It seems like the issue is related to unstable-core-do-not-import. I am currently using tsgolint for linting, and tsgo no longer supports baseUrl, which might be the root cause of this issue.

Steps to reproduce:

Remove the baseUrl configuration from tsconfig.json.

Link to reproduction

none

To reproduce

remove tsconfig baseUrl

Additional information

No response

👨‍👧‍👦 Contributing
  • 🙋‍♂️ Yes, I'd be down to file a PR fixing this bug!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting src/middleware/jwt/index.ts:11 and the repository's tsconfig.json, then reproduce the TS2742 error after removing baseUrl. Trace how jwtMiddleware's inferred type references unstable-core-do-not-import, and consider the reported tsgo limitation. Done means the project no longer reports this error without baseUrl.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, authentication
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.