Skip to content
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

npm "next" 14.0.4 module high severity vulnerability and breaking change #440

Open
WEMcJJJ opened this issue Oct 2, 2024 · 0 comments
Open

Comments

@WEMcJJJ
Copy link

WEMcJJJ commented Oct 2, 2024

In working on this locally, running "npm install" showed that there were some packages that needed to be updated, so I updated them, however, there was one package, next, that it didn't update because doing so would be outside the stated dependency range. If I force the update, or change the dependency range (after all other packages have been updated), it beaks the ability to login (this is for version 14.2.14 of next). After successfully authenticating it redirects you back to the login page, and I see the following errors:

From the terminal in VS Code:

unhandledRejection: Error: NEXT_REDIRECT
    at getRedirectError (webpack-internal:///(rsc)/./node_modules/next/dist/client/components/redirect.js:49:19)
    at redirect (webpack-internal:///(rsc)/./node_modules/next/dist/client/components/redirect.js:60:11)
    at $$ACTION_1 (webpack-internal:///(rsc)/./features/common/navigation-helpers.ts:32:62)
    at redirectIfAuthenticated (webpack-internal:///(rsc)/./features/auth-page/helpers.ts:53:83)
    at async Home (webpack-internal:///(rsc)/./app/page.tsx:13:5) {
  digest: 'NEXT_REDIRECT;replace;/chat;307;',
  mutableCookies: p {
    _parsed: Map(3) {
      'next-auth.csrf-token' => [Object],
      'next-auth.callback-url' => [Object],
      'next-auth.session-token' => [Object]
    },
    _headers: HeadersList {
      cookies: [Array],
      [Symbol(headers map)]: [Map],
      [Symbol(headers map sorted)]: null
    }
  }
}

From the Debug Console in VS Code:

unhandledRejection: Error: NEXT_REDIRECT
    at getRedirectError (webpack-internal:///(rsc)/./node_modules/next/dist/client/components/redirect.js:49:19)
    at redirect (webpack-internal:///(rsc)/./node_modules/next/dist/client/components/redirect.js:60:11)
    at $$ACTION_1 (webpack-internal:///(rsc)/./features/common/navigation-helpers.ts:32:62)
    at redirectIfAuthenticated (webpack-internal:///(rsc)/./features/auth-page/helpers.ts:53:83)
    at async Home (webpack-internal:///(rsc)/./app/page.tsx:13:5) {digest: 'NEXT_REDIRECT;replace;/chat;307;', mutableCookies: Proxy(p), stack: 'Error: NEXT_REDIRECT
    at getRedirectError …ebpack-internal:///(rsc)/./app/page.tsx:13:5)', message: 'NEXT_REDIRECT'}

I've done some searching and testing of potential fixes but can't figure out how to resolve the issue. It appears to be related to how next handles the redirect (see this issue and this issue), but even after I've tried adding some try/catch blocks it still throws the same error and redirects to the login page. Any help would be much appreciated, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant