Named export from package.json 4.0.3 in auth-client.js
Checklist
- [x] The issue can be reproduced in the nextjs-auth0 sample app (or N/A).
- [x] I have looked into the Readme, Examples, and FAQ and have not found a suitable solution or answer.
- [x] I have looked into the API documentation and have not found a suitable solution or answer.
- [x] I have searched the issues and have not found a suitable solution or answer.
- [x] I have searched the Auth0 Community forums and have not found a suitable solution or answer.
- [x] I agree to the terms within the Auth0 Code of Conduct.
Description
After upgrading to 4.0.3, i get the warning
./node_modules/@auth0/nextjs-auth0/dist/server/auth-client.js
Should not import the named export 'version' (imported as 'version') from default-exporting module (only default export is available soon)
Reproduction
Upgrade to @auth0/nextjs-auth0 4.0.3
Additional context
This could probably be solved by using a default import from package.json in auth-client.js and getting the version from the object
nextjs-auth0 version
4.0.3
Next.js version
15.2.2
Node.js version
v20.18.3
Same issue for me here ! I've just upgraded my version to 4.0.3 and had the same error message.
Downgrading to 4.0.2 fix it, for now.
Also getting this, seems to be due to the change here where version is now being imported from package.json: https://github.com/auth0/nextjs-auth0/commit/bc71be85e09d6c03c7a0d4b6a7210fba0a18f529#diff-f286f78bd0e95e3de4a2adaeabd5ec5d2033af74e1f65969c961e6dbc18eea19R5
Steps to reproduce:
- Create a fresh Next.js app with
npx create-next-app@latest- Use the default settings for everything except the "Would you like to use Turbopack" question, set that to "No"
- Navigate to that app's directory and install nextjs-auth0:
npm install @auth0/[email protected] - Import the library in
app/page.tsx:import { AuthClient } from "@auth0/nextjs-auth0/server"; // Do something with it console.log(AuthClient); - Run the app with
npm run devand open it in a browser, the warnings will be logged in the server console. Alternatively, build the app withnpm run build, the warning will be logged during the build.
I created #1960 which fixes this warning
This was fixed and released in v4.1.0 https://www.npmjs.com/package/@auth0/nextjs-auth0/v/4.1.0 https://github.com/auth0/nextjs-auth0/releases/tag/v4.1.0