nextjs-auth0 icon indicating copy to clipboard operation
nextjs-auth0 copied to clipboard

Named export from package.json 4.0.3 in auth-client.js

Open adneforslund opened this issue 1 year ago • 4 comments

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

adneforslund avatar Mar 11 '25 12:03 adneforslund

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.

TheoCanonne avatar Mar 12 '25 09:03 TheoCanonne

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:

  1. 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"
  2. Navigate to that app's directory and install nextjs-auth0: npm install @auth0/[email protected]
  3. Import the library in app/page.tsx:
    import { AuthClient } from "@auth0/nextjs-auth0/server";
    
    // Do something with it
    console.log(AuthClient);
    
  4. Run the app with npm run dev and open it in a browser, the warnings will be logged in the server console. Alternatively, build the app with npm run build, the warning will be logged during the build.

mogzol avatar Mar 13 '25 01:03 mogzol

I created #1960 which fixes this warning

mogzol avatar Mar 13 '25 02:03 mogzol

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

tusharpandey13 avatar Mar 13 '25 09:03 tusharpandey13