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

[BUG] [Next 15.0.4 canary] Internal framework (rethrown) errors are broken #299

Closed
2 tasks done
MrOxMasTer opened this issue Nov 22, 2024 · 9 comments · Fixed by #305
Closed
2 tasks done

[BUG] [Next 15.0.4 canary] Internal framework (rethrown) errors are broken #299

MrOxMasTer opened this issue Nov 22, 2024 · 9 comments · Fixed by #305
Labels
bug Something isn't working

Comments

@MrOxMasTer
Copy link

MrOxMasTer commented Nov 22, 2024

Are you using the latest version of this library?

  • I verified that the issue exists in the latest next-safe-action release

Is there an existing issue for this?

  • I have searched the existing issues and found nothing that matches

Describe the bug

I have no idea what it's about

Reproduction steps

  1. Try entering mail in the field with unstable_cache
  2. Try to enter mail again in the field with unstable_cache and look at the logs (make sure there are no errors)
  3. Try to enter the mail again in the “use cache” field and make sure that the error pops up.

I tested: it happens even without use cache or unstable_cache``. It happens in canarybecause it does not happen in15.0.3`:

[ Server ] Error: (0 , next_dist_client_components_not_found_js__WEBPACK_IMPORTED_MODULE_0__.isNotFoundError) is not a function

Expected behavior

no Error

Link to a minimal reproduction of the issue

https://codesandbox.io/p/devbox/keen-cloud-gggnf4

Operating System

Windows 11

Library version

7.9.9

Next.js version

15.0.4-canary.23-24

Node.js version

22.10.0

Additional context

No response

@MrOxMasTer MrOxMasTer added the bug Something isn't working label Nov 22, 2024
@MrOxMasTer MrOxMasTer changed the title [BUG] [NEXT15@canary] Server ] Error: (0 , next_dist_client_components_not_found_js__WEBPACK_IMPORTED_MODULE_0__.isNotFoundError) is not a function [BUG] [NEXT15@canary] [ Server ] Error: (0 , next_dist_client_components_not_found_js__WEBPACK_IMPORTED_MODULE_0__.isNotFoundError) is not a function Nov 22, 2024
@LouisCuvelier
Copy link

LouisCuvelier commented Nov 27, 2024

I'm getting the same kind of message on latest Next's canary branch

Internal error: TypeError: (0 , next_dist_client_components_not_found_js__WEBPACK_IMPORTED_MODULE_0__.isNotFoundError) is not a function at executeMiddlewareStack

@MrOxMasTer
Copy link
Author

timestamp=2024-12-01T19:30:54.724Z level=ERROR fiber=#96 message={}
timestamp=2024-12-01T19:30:54.729Z level=ERROR fiber=#96 message={}
timestamp=2024-12-01T19:30:54.732Z level=ERROR fiber=#96 message={}
 ⨯ node_modules\.pnpm\[email protected][email protected]_@[email protected][email protected]_pggdoqi72ubjxucbt36c45hjkm\node_modules\next-safe-action\dist\index.mjs (502:49) @ executeMiddlewareStack       
 ⨯ Internal error: TypeError: (0 , next_dist_client_components_not_found_js__WEBPACK_IMPORTED_MODULE_0__.isNotFoundError) is not a function
    at executeMiddlewareStack (./node_modules/.pnpm/[email protected][email protected]_@[email protected][email protected]_pggdoqi72ubjxucbt36c45hjkm/node_modules/next-safe-action/dist/index.mjs:518:196)  
    at async eval (./node_modules/.pnpm/[email protected][email protected]_@[email protected][email protected]_pggdoqi72ubjxucbt36c45hjkm/node_modules/next-safe-action/dist/index.mjs:548:6)
    at async C:\Users\oxmas\Desktop\petProjects\shopco\node_modules\.pnpm\[email protected]_@[email protected][email protected][email protected]_a4tzqh3r6ouihinqpquitzmgki\node_modules\next\dist\compiled\next-server\app-page-experimental.runtime.dev.js:157:2088 
    at async handleAction (C:\Users\oxmas\Desktop\petProjects\shopco\node_modules\.pnpm\[email protected]_@[email protected][email protected][email protected]_a4tzqh3r6ouihinqpquitzmgki\node_modules\next\dist\compiled\next-server\app-page-experimental.runtime.dev.js:156:20482)
    at async renderToHTMLOrFlightImpl (C:\Users\oxmas\Desktop\petProjects\shopco\node_modules\.pnpm\[email protected]_@[email protected][email protected][email protected]_a4tzqh3r6ouihinqpquitzmgki\node_modules\next\dist\compiled\next-server\app-page-experimental.runtime.dev.js:161:22008)
    at async doRender (C:\Users\oxmas\Desktop\petProjects\shopco\node_modules\.pnpm\[email protected]_@[email protected][email protected][email protected]_a4tzqh3r6ouihinqpquitzmgki\node_modules\next\dist\server\base-server.js:1571:34)
    at async responseGenerator (C:\Users\oxmas\Desktop\petProjects\shopco\node_modules\.pnpm\[email protected]_@[email protected][email protected][email protected]_a4tzqh3r6ouihinqpquitzmgki\node_modules\next\dist\server\base-server.js:1819:28)
    at async DevServer.renderToResponseWithComponentsImpl (C:\Users\oxmas\Desktop\petProjects\shopco\node_modules\.pnpm\[email protected]_@[email protected][email protected][email protected]_a4tzqh3r6ouihinqpquitzmgki\node_modules\next\dist\server\base-server.js:1829:28)
    at async DevServer.renderPageComponent (C:\Users\oxmas\Desktop\petProjects\shopco\node_modules\.pnpm\[email protected]_@[email protected][email protected][email protected]_a4tzqh3r6ouihinqpquitzmgki\node_modules\next\dist\server\base-server.js:2251:24)      
    at async DevServer.renderToResponseImpl (C:\Users\oxmas\Desktop\petProjects\shopco\node_modules\.pnpm\[email protected]_@[email protected][email protected][email protected]_a4tzqh3r6ouihinqpquitzmgki\node_modules\next\dist\server\base-server.js:2289:32)     
    at async DevServer.pipeImpl (C:\Users\oxmas\Desktop\petProjects\shopco\node_modules\.pnpm\[email protected]_@[email protected][email protected][email protected]_a4tzqh3r6ouihinqpquitzmgki\node_modules\next\dist\server\base-server.js:961:25)
    at async NextNodeServer.handleCatchallRenderRequest (C:\Users\oxmas\Desktop\petProjects\shopco\node_modules\.pnpm\[email protected]_@[email protected][email protected][email protected]_a4tzqh3r6ouihinqpquitzmgki\node_modules\next\dist\server\next-server.js:278:17)
    at async DevServer.handleRequestImpl (C:\Users\oxmas\Desktop\petProjects\shopco\node_modules\.pnpm\[email protected]_@[email protected][email protected][email protected]_a4tzqh3r6ouihinqpquitzmgki\node_modules\next\dist\server\base-server.js:854:17)
    at async C:\Users\oxmas\Desktop\petProjects\shopco\node_modules\.pnpm\[email protected]_@[email protected][email protected][email protected]_a4tzqh3r6ouihinqpquitzmgki\node_modules\next\dist\server\dev\next-dev-server.js:372:20
    at async Span.traceAsyncFn (C:\Users\oxmas\Desktop\petProjects\shopco\node_modules\.pnpm\[email protected]_@[email protected][email protected][email protected]_a4tzqh3r6ouihinqpquitzmgki\node_modules\next\dist\trace\trace.js:153:20)
    at async DevServer.handleRequest (C:\Users\oxmas\Desktop\petProjects\shopco\node_modules\.pnpm\[email protected]_@[email protected][email protected][email protected]_a4tzqh3r6ouihinqpquitzmgki\node_modules\next\dist\server\dev\next-dev-server.js:369:24)     
    at async invokeRender (C:\Users\oxmas\Desktop\petProjects\shopco\node_modules\.pnpm\[email protected]_@[email protected][email protected][email protected]_a4tzqh3r6ouihinqpquitzmgki\node_modules\next\dist\server\lib\router-server.js:183:21)
    at async handleRequest (C:\Users\oxmas\Desktop\petProjects\shopco\node_modules\.pnpm\[email protected]_@[email protected][email protected][email protected]_a4tzqh3r6ouihinqpquitzmgki\node_modules\next\dist\server\lib\router-server.js:361:24)
    at async requestHandlerImpl (C:\Users\oxmas\Desktop\petProjects\shopco\node_modules\.pnpm\[email protected]_@[email protected][email protected][email protected]_a4tzqh3r6ouihinqpquitzmgki\node_modules\next\dist\server\lib\router-server.js:385:13)
    at async Server.requestListener (C:\Users\oxmas\Desktop\petProjects\shopco\node_modules\.pnpm\[email protected]_@[email protected][email protected][email protected]_a4tzqh3r6ouihinqpquitzmgki\node_modules\next\dist\server\lib\start-server.js:144:13)
digest: "3114230114"
  500 |                                                 }
  501 |                                                 }
 catch (e) {
> 502 |                                                 if (isRedirectError(e) || isNotFoundError(e)) {
      |                                                  
                                        ^
  503 |                                                 middlewareResult.success = true;
  504 |                                                 frameworkError = e;
  505 |                                                 return;
 POST /auth 500 in 322ms

@typeofweb
Copy link

Temp solution is to downgrade to [email protected].

@hoangtrung99
Copy link

hoangtrung99 commented Dec 6, 2024

I encountered a similar issue with the latest version of Next.js today. [email protected]

[ Server ] Error: (0 , next_dist_client_components_redirect_js__WEBPACK_IMPORTED_MODULE_1__.isRedirectError) is not a function

@TheEdoRan
Copy link
Owner

v7.9.10-beta.1 should solve these issues. However, due to changes in Next.js's internal error handling mechanism, the next stable release of this library will only be compatible starting from the upcoming Next.js version (presumably 15.0.5). I really don't want to introduce breaking changes, but there's little I can do about it, since the underlying framework APIs have changed a lot, and this library heavily relies on them.

Let me know if the beta version solves these issues for you as well using Next.js canary, thanks!

@TheEdoRan TheEdoRan changed the title [BUG] [NEXT15@canary] [ Server ] Error: (0 , next_dist_client_components_not_found_js__WEBPACK_IMPORTED_MODULE_0__.isNotFoundError) is not a function [BUG] [Next 15.0.4 canary] Internal framework (rethrown) errors are broken Dec 7, 2024
@niikeec
Copy link

niikeec commented Dec 8, 2024

@TheEdoRan issue solved, thanks for the update

@TheEdoRan TheEdoRan mentioned this issue Dec 8, 2024
@TheEdoRan TheEdoRan linked a pull request Dec 8, 2024 that will close this issue
@MrOxMasTer
Copy link
Author

v7.9.10-beta.1 should solve these issues. However, due to changes in Next.js's internal error handling mechanism, the next stable release of this library will only be compatible starting from the upcoming Next.js version (presumably 15.0.5). I really don't want to introduce breaking changes, but there's little I can do about it, since the underlying framework APIs have changed a lot, and this library heavily relies on them.

https://nextjs.org/blog/next-15-1
I think it's possible to go from 15.0.5, not 15.1.0 anymore
(P.S. 15.0.5 just doesn't exist).

@headironc
Copy link

headironc commented Dec 11, 2024

Similar issue [email protected]

[ Server ] Error: (0 , {imported module [project]/nodemodules/.pnpm/[email protected]@[email protected][email protected]/nodemodules/next/dist/client/components/redirect.js [app-rsc] (ecmascript)}.isRedirectError) is not a function

And v7.9.10-beta.1 solved this issue.

@TheEdoRan
Copy link
Owner

@headironc Yep, 15.0.4-canary has been released as stable 15.1.

TheEdoRan added a commit that referenced this issue Dec 11, 2024
7.10.0 release:
- updates and fixes the internal framework error handling detection, for
Next.js errors that have to be rethrown
- requires action callbacks and validation error shaper functions to be
async (see
[this](vercel/next.js#72336 (comment))).

The minimum required Next.js version will be stable 15.1 and minimum
React version will be 19. Older framework versions will not work with
next-safe-action >= 7.10.0, and vice versa.

## Related issue(s) or discussion(s)

- #288 
- #299
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants