-
Notifications
You must be signed in to change notification settings - Fork 397
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
V4 Nextjs 15 pages router "Failed to load external module" on any import #1795
Comments
Hi @MrSimmmons 👋 Thanks for reporting this! I've just pushed a fix — could I kindly ask you to upgrade to |
@guabu Hey thanks! it seems to have worked for the client side, but SSR pages & server actions still seem to be getting the same error Im guessing that you will have to do the same |
Hey @MrSimmmons 👋 We've been doing some investigation around this and it looks like there's a difference in how Next.js resolves & transpiles packages for App router vs Pages router. The next release will include a fix for this. For the time being, you can add the following to your transpilePackages: ["@auth0/nextjs-auth0"] |
Ah awesome that appears to be working now. Ill leave this ticket open and you can close it when the fix is merged |
Hi @MrSimmmons 👋 We've cut a new release which addresses this issue. You should now be able to upgrade to the latest and revert any modifications from your Thanks again for reporting this! |
@guabu Awesome just tried it out. Works great thanks guys! Just so y'all know there is another issue with the pages router that I reported over at #1801 Thanks again! |
Checklist
Description
Using the Nextjs v15 Pages Router with the V4 readme (up to step 4 is enough) will fail to load or build with the following error in browser
and in terminal
I am able to successfully get all the exports to work if i manually import the exact path to the folders index file (or directly to the file its self.
Reproduction
Additional context
VSCode IntelliSense still works on the import functions and classes. So I can still command click them and VSCode will take me to their type sources, and autocomplete still functions. However this is annoying in this sense because the autocompleted "path" is causing the error and I have to manually modify the path as shown above to address it.
I noticed that the provided App Router example works fine so it must be just an issue with the Pages Router
Having your code in a
/src
directory or not makes no differenceThe directory that the import errors are completing about are correct import paths (aside from maybe the file extension being omitted in the error? That might be the only thing that looks slightly off to me) as I can put them into finder and go to the correct place.
nextjs-auth0 version
V4.0.0 beta 0
Next.js version
15.0.3
Node.js version
20.18.0
The text was updated successfully, but these errors were encountered: