You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using PlayWrite and need to generate a session by generateSessionCookie, this function can be imported in other files but not in testing files, I got this error: Error: Package subpath './testing' is not defined by "exports" in /Users/......./node_modules/@auth0/nextjs-auth0/package.json
Thank you for reporting this issue. This is a bug in our exports configuration - the testing utilities aren't properly exposed in the package.json. We'll fix this in our next release.
The fix adds the proper exports configuration:
"exports": {"./testing": {"types": "./dist/testing/index.d.ts","default": "./dist/testing/index.js"},// other existing exports}
As a temporary workaround, you can use a direct import:
Hey @tusharpandey13 the temp solution not working as well, got error Error: Package subpath './dist/testing' is not defined by "exports"
And v4.1.0 still have original error
Checklist
Description
We are using PlayWrite and need to generate a session by
generateSessionCookie
, this function can be imported in other files but not in testing files, I got this error:Error: Package subpath './testing' is not defined by "exports" in /Users/......./node_modules/@auth0/nextjs-auth0/package.json
Some other people also face same error: #1857
Reproduction
Follow this example https://github.com/auth0/nextjs-auth0/blob/main/EXAMPLES.md#generatesessioncookie in testing file
Additional context
No response
nextjs-auth0 version
4.0.2
Next.js version
15.1.6
Node.js version
22.13.0
The text was updated successfully, but these errors were encountered: