auth0 - handleAuth is not a function when building nextjs project or trying to deploy to AWS Amplify - Stack Overflow

I am trying to build my nextjs application using 'npm run build'.I have connected my project

I am trying to build my nextjs application using 'npm run build'. I have connected my project with Auth0 and it is working when I am using it locally.

I have the .env.local and .env file with the appropriate values in there.

This is the error I get:

Collecting page data  ..TypeError: (0 , n.handleAuth) is not a function
    at 65055 (C:\Webprojects\DeltoneNGCRM\deltonenextgencrm\.next\server\app\api\auth\[auth0]\route.js:1:13559)
    at t (C:\Webprojects\DeltoneNGCRM\deltonenextgencrm\.next\server\webpack-runtime.js:1:143)
    at r (C:\Webprojects\DeltoneNGCRM\deltonenextgencrm\.next\server\app\api\auth\[auth0]\route.js:1:14949)
    at <unknown> (C:\Webprojects\DeltoneNGCRM\deltonenextgencrm\.next\server\app\api\auth\[auth0]\route.js:1:14976)
    at t.X (C:\Webprojects\DeltoneNGCRM\deltonenextgencrm\.next\server\webpack-runtime.js:1:1285)
    at <unknown> (C:\Webprojects\DeltoneNGCRM\deltonenextgencrm\.next\server\app\api\auth\[auth0]\route.js:1:14962)
    at Object.<anonymous> (C:\Webprojects\DeltoneNGCRM\deltonenextgencrm\.next\server\app\api\auth\[auth0]\route.js:1:15004)

> Build error occurred
[Error: Failed to collect page data for /api/auth/[auth0]] {
  type: 'Error'
}

I have a route.js file located in '/api/auth/[auth0]/route.js' which contains the following code:

import { handleAuth } from "@auth0/nextjs-auth0";

export const GET = handleAuth();

Can someone please help me out with this?

Researched on Google for Auth0 build related issues.

Deleted node_modules and package-lock.json and reinstalled the packages

Previous AWS Amplify builds (before Auth0) are successful.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744748415a4591446.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信