-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
The inferred type of 'loader' cannot be named without a reference #3758
Comments
This is because your project has the @typescript-eslint/explicit-function-return-type eslint rule turned on, which doesn't let you have a plain
|
@dmarkow thanks for the tip, but I raised issue about typescript error and not eslint, look at the last part on screenshot. |
Solved by installing |
@ziimakc Ahh, sorry -- didn't catch that! |
@ziimakc you shouldn't have to install that package directly. Remix type inference is working fine for me on a vanilla Remix App Server project. I wonder if it's a PNPM related issue. |
I'm seeing this too with pnpm and installing But I think I known why this is happening. The "cannot be named without a reference to" error usually means that a package is exporting a type that is using another type that is not exported. It seems that definitions are in the remix/packages/remix-server-runtime/responses.ts Lines 1 to 30 in db0619d
But only the remix/packages/remix-node/index.ts Lines 38 to 49 in db0619d
which causes the "cannot be named without a reference to" error. I can actually fix this error by patching the exports to the remix-type-bug.mp4Submitted a PR #3797 |
fixed |
What version of Remix are you using?
1.6.5
Steps to Reproduce
pnpm@7.5.1
typescript@4.7.3
tsconfig:
Expected Behavior
No error should be shown
Actual Behavior
VSCode shows error:
The text was updated successfully, but these errors were encountered: