TypeScript File name differs from already included file name (Error TS1149) #4728
Replies: 2 comments 4 replies
-
Could probably just turn that file into TS. Want to open a PR? |
Beta Was this translation helpful? Give feedback.
4 replies
-
A PR to migrate the provider to TypeScript has been opened #4929 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone, I am struggling with some weird TypeScript behaviour at the moment, so I'm opening this discussion to seek for help. I don't know if this might be an issue, if there is any contributor reading this, feel free to convert this to an issue if it helps.
I'm using Next Auth with TypeScript, I did implement the GitHub provider and everything was smooth and working like a charm.
Now I try to implement the GitLab provider, and I have the following issue with TypeScript:
You can find a complete output through this link or in the detail below
Complete output of the `yarn tsc --noEmit` command input
The thing is, I have an
src/Providers.tsx
file in my project that I use to put some of my code, like Chakra UI Provider, React Query Provider and others.Also, the GitLab Provider is importing type definitions from
src/providers
(and./providers
by the way, like GitHub Provider is doing).next-auth/packages/next-auth/src/providers/gitlab.js
Line 1 in 7cf4956
To check if my theory was correct, I updated the generated types to replace:
with the same generated code than the GitHub adapter, and it works well:
So I'm wondering, is there a way to avoid name clashing (I don't really want to rename my file, but if it is the only way I'll do it)? Is it a mistake from the
gitlab.js
provider? Anything else?Thanks a lot for your time and consideration, and thanks a lot to Next Auth maintainers, it is an awesome lib to work with.
Beta Was this translation helpful? Give feedback.
All reactions