-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
fix: Add default exports to next-auth's package.json for better module support #11254
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
@FckYeah is attempting to deploy a commit to the authjs Team on Vercel. A member of the Team first needs to authorize it. |
Two package.json files have been sorted automatically, my guess 'auth-docs' deployment failed because of it. Could you re-run it? Edit: Nevermind, it's done automatically 👍 |
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #11254 +/- ##
=======================================
Coverage ? 39.92%
=======================================
Files ? 179
Lines ? 28669
Branches ? 1249
=======================================
Hits ? 11445
Misses ? 17224
Partials ? 0 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @FckYeah 🙏
☕️ Reasoning
When using Auth + NextJS in a ModernJS project, I ran through this error
[Error - 15:45:37] Error: No "exports" main defined in __PROJECT_PATH__/node_modules/next-auth/package.json Occurred while linting __PROJECT_PATH__/middleware.js:1 Rule: "import/named" at new NodeError (node:internal/errors:406:5) at exportsNotFound (node:internal/modules/esm/resolve:268:10) at packageExportsResolve (node:internal/modules/esm/resolve:542:13) at resolveExports (node:internal/modules/cjs/loader:554:36) at Module._findPath (node:internal/modules/cjs/loader:628:31) at findModulePath (__PROJECT_PATH__/node_modules/eslint-import-resolver-alias/index.js:99:27) at exports.resolve (__PROJECT_PATH__/node_modules/eslint-import-resolver-alias/index.js:75:10) at withResolver (__PROJECT_PATH__/node_modules/eslint-module-utils/resolve.js:121:23) at fullResolve (__PROJECT_PATH__/node_modules/eslint-module-utils/resolve.js:142:22) at Function.relative (__PROJECT_PATH__/node_modules/eslint-module-utils/resolve.js:158:10) at remotePath (__PROJECT_PATH__/node_modules/eslint-plugin-import/lib/ExportMap.js:811:381) at captureDependency (__PROJECT_PATH__/node_modules/eslint-plugin-import/lib/ExportMap.js:817:463) at captureDependencyWithSpecifiers (__PROJECT_PATH__/node_modules/eslint-plugin-import/lib/ExportMap.js:817:144) at __PROJECT_PATH__/node_modules/eslint-plugin-import/lib/ExportMap.js:822:42 at Array.forEach (<anonymous>) at ExportMap.parse (__PROJECT_PATH__/node_modules/eslint-plugin-import/lib/ExportMap.js:821:427) at ExportMap.for (__PROJECT_PATH__/node_modules/eslint-plugin-import/lib/ExportMap.js:807:201) at ExportMap.get (__PROJECT_PATH__/node_modules/eslint-plugin-import/lib/ExportMap.js:801:465) at checkSpecifiers (__PROJECT_PATH__/node_modules/eslint-plugin-import/lib/rules/named.js:44:46) at ruleErrorHandler (__PROJECT_PATH__/node_modules/eslint/lib/linter/linter.js:1107:28) at __PROJECT_PATH__/node_modules/eslint/lib/linter/safe-emitter.js:45:58 at Array.forEach (<anonymous>) at Object.emit (__PROJECT_PATH__/node_modules/eslint/lib/linter/safe-emitter.js:45:38) at NodeEventGenerator.applySelector (__PROJECT_PATH__/node_modules/eslint/lib/linter/node-event-generator.js:297:26) at NodeEventGenerator.applySelectors (__PROJECT_PATH__/node_modules/eslint/lib/linter/node-event-generator.js:326:22) at NodeEventGenerator.enterNode (__PROJECT_PATH__/node_modules/eslint/lib/linter/node-event-generator.js:340:14) at CodePathAnalyzer.enterNode (__PROJECT_PATH__/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js:795:23) at __PROJECT_PATH__/node_modules/eslint/lib/linter/linter.js:1138:32 at Array.forEach (<anonymous>) at runRules (__PROJECT_PATH__/node_modules/eslint/lib/linter/linter.js:1133:15) at Linter._verifyWithoutProcessors (__PROJECT_PATH__/node_modules/eslint/lib/linter/linter.js:1382:31) at Linter._verifyWithConfigArray (__PROJECT_PATH__/node_modules/eslint/lib/linter/linter.js:1722:21) at Linter.verify (__PROJECT_PATH__/node_modules/eslint/lib/linter/linter.js:1464:65) at Linter.verifyAndFix (__PROJECT_PATH__/node_modules/eslint/lib/linter/linter.js:1946:29) at verifyText (__PROJECT_PATH__/node_modules/eslint/lib/cli-engine/cli-engine.js:244:48) at CLIEngine.executeOnText (__PROJECT_PATH__/node_modules/eslint/lib/cli-engine/cli-engine.js:918:26)
It's the same approach as in the other PR #11224
🧢 Checklist
🎫 Affected issues
📌 Resources