Skip to content

Commit

Permalink
fix(nextjs): Stop exporting the /api helpers based on the runtime
Browse files Browse the repository at this point in the history
All of our helpers are isomorphic, so there's no need to check the runtime anymore.
  • Loading branch information
nikosdouvlis committed Mar 7, 2023
1 parent aa1421e commit 224426a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
1 change: 0 additions & 1 deletion packages/nextjs/api.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
// TODO: Dynamic typings based on process
export * from './dist/api';
11 changes: 1 addition & 10 deletions packages/nextjs/api.js
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
let exportLib;
if (process.env.NEXT_RUNTIME === 'edge') {
exportLib = require('./dist/edge-middleware');
exportLib.withAuth = exportLib.withEdgeMiddlewareAuth;
exportLib.requireAuth = exportLib.requireEdgeMiddlewareAuth;
} else {
exportLib = require('./dist/api');
}

module.exports = exportLib;
module.exports = require('./dist/api');

0 comments on commit 224426a

Please sign in to comment.