-
Notifications
You must be signed in to change notification settings - Fork 408
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
Typescript support for moduleResolution: node #1816
Comments
Hey @redbmk 👋 Thanks for reporting this! We're now including |
I ran into this same issue after attempting to upgrade my project to use v4.0.0-beta.9. However, the workaround provided by @redbmk didn't work for me. I am on the brink of giving up. Any idea when the next release will be pushed? |
Hey @fated-x, the next release should be out early next week! |
This issue is fixed on |
Checklist
Describe the problem you'd like to have solved
I'm using
v4.0.0-beta.7
and my tsconfig.json has"moduleResolution": "node"
. I cannot import types via@auth0/nextjs-auth0/server
as documented (webpack is able to load it ok). I've tried switching my module resolution to typescript's recommended suggestions ("node16", "nodenext", or "bundler"), however any of those end up breaking imports for other libraries I'm using.Typescript can import from
@auth0/nextjs-auth0/dist/server
, but then webpack (potentially other bundlers as well) has issues importing from there.Describe the ideal solution
Ideally we would be able to import the types even when moduleResolution is set to "node". This worked in v3 and I haven't run into this issue with any other libraries yet.
Alternatives and current workarounds
A workaround is to create a path alias in tsconfig:
Another possible workaround (untested) is to import from
@auth0/nextjs-auth0/dist/server
and teach the bundler (webpack in this case) how to handle that properly. This seems less ideal having to import from/dist
.Additional context
I was going to file this as a bug, but it requires checking that:
...which is coded against v3 and doesn't seem to use typescript. It might be worth updating that to be an optional checkmark now that v4 is the main focus
The text was updated successfully, but these errors were encountered: