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

[WEB-902] [turbopack] API routes in nextjs 13.3 stopped working #4547

Closed
masterkain opened this issue Apr 12, 2023 · 6 comments
Closed

[WEB-902] [turbopack] API routes in nextjs 13.3 stopped working #4547

masterkain opened this issue Apr 12, 2023 · 6 comments
Assignees
Labels
kind: bug Something isn't working linear

Comments

@masterkain
Copy link

masterkain commented Apr 12, 2023

What version of Turborepo are you using?

not sure, whatever comes with next 13.3.0

What package manager are you using / does the bug impact?

pnpm

What operating system are you using?

Mac

Describe the Bug

GET http://localhost:3000/api/listings

error rendering: TypeError: Cannot read properties of undefined (reading 'middleware_edge')

Debug info:
- error rendering: TypeError: Cannot read properties of undefined (reading 'middleware_edge')
      [at file:///Users/kain/src/videoexplorer/frontend/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/web/sandbox/sandbox.js:67:50]
      [at process.processTicksAndRejections (node:internal/process/task_queues:95:5)]
      [at async Module.runEdgeFunction (file:///Users/kain/src/videoexplorer/frontend/.next/server/app/chunks/ssr/[next]_internal_edge.ts_4acfa5._.js:28:20)]
      [at async (file:///Users/kain/src/videoexplorer/frontend/.next/server/app/chunks/ssr/_c634e4._.js:92:5)]
      [at async endOperation (file:///Users/kain/src/videoexplorer/frontend/.next/server/app/chunks/ssr/[next]_internal_08c02e._.js:152:13)]
      [at async (file:///Users/kain/src/videoexplorer/frontend/.next/server/app/chunks/ssr/[next]_internal_08c02e._.js:100:13)]

status: exit status: 1

Expected Behavior

without --turbo the endpoint works.

To Reproduce

Screen Shot 2023-04-12 at 14 44 14

Reproduction Repo

No response

WEB-902

@masterkain masterkain added area: turborepo kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage labels Apr 12, 2023
@masterkain masterkain changed the title [turborepo] API routes in nextjs 13 stopped working [turborepo] API routes in nextjs 13.3 stopped working Apr 12, 2023
@masterkain masterkain changed the title [turborepo] API routes in nextjs 13.3 stopped working [turbopack] API routes in nextjs 13.3 stopped working Apr 12, 2023
@VaniaPopovic
Copy link

Experiencing similar but different issue TypeError: Cannot read properties of undefined (reading 'middleware_middleware') on the latest 13.1 canary 4.

Full error log:
`Debug info:

  • Execution of get_from_source failed
  • Execution of resolve_source_request failed
  • Execution of NextRouterContentSource::get failed
  • error during Next.js routing for /
  • TypeError: Cannot read properties of undefined (reading 'middleware_middleware')
    [at file://C:\Users\fream\Desktop\BOBBLL\bobbll.crm.next\node_modules.pnpm\[email protected][email protected][email protected]\node_modules\next\dist\server\web\sandbox\sandbox.js:67:50]
    [at async TurbopackDevServerProxy.runMiddleware (file://C:\Users\fream\Desktop\BOBBLL\bobbll.crm.next\node_modules.pnpm\[email protected][email protected][email protected]\node_modules\next\dist\server\next-server.js:1409:24)]
    [at async TurbopackDevServerProxy.runMiddleware (file://C:\Users\fream\Desktop\BOBBLL\bobbll.crm.next\node_modules.pnpm\[email protected][email protected][email protected]\node_modules\next\dist\server\dev\next-dev-server.js:774:28)]
    [at async Object.fn (file://C:\Users\fream\Desktop\BOBBLL\bobbll.crm.next\node_modules.pnpm\[email protected][email protected][email protected]\node_modules\next\dist\server\next-server.js:1552:42)]
    [at async Router.execute (file://C:\Users\fream\Desktop\BOBBLL\bobbll.crm.next\node_modules.pnpm\[email protected][email protected][email protected]\node_modules\next\dist\server\router.js:297:32)]
    [at async resolveRoute (file://C:\Users\fream\Desktop\BOBBLL\bobbll.crm.next\node_modules.pnpm\[email protected][email protected][email protected]\node_modules\next\dist\server\lib\route-resolver.js:171:9)]
    [at async Module.route (file://C:\Users\fream\Desktop\BOBBLL\bobbll.crm.next.next\build\chunks\router[next]entry_router.ts_3d8e62..js:44:28)]
    [at async Module.run (file://C:\Users\fream\Desktop\BOBBLL\bobbll.crm.next.next\build\chunks\router[turbopack-node]ipc_evaluate.ts_d53664..js:177:39)]`

@padmaia padmaia added the linear label Apr 13, 2023
@padmaia padmaia changed the title [turbopack] API routes in nextjs 13.3 stopped working [WEB-902] [turbopack] API routes in nextjs 13.3 stopped working Apr 13, 2023
@padmaia padmaia removed the needs: triage New issues get this label. Remove it after triage label Apr 13, 2023
@masterkain
Copy link
Author

masterkain commented Apr 25, 2023

meanwhile I did some progress on the app and retried turbo, I'm using now aws sdk v3 in my route handlers and I have this:

error rendering: Error: Cannot find module 'os'

Debug info:
- error rendering: Error: Cannot find module 'os'
      [at file:///app/.next/server/app/edge/chunks/app_api_listings_[[...key]]_route.ts_next-edge-bootstrap.ts_fc1fbe._.js]
      [at file:///app/.next/server/app/edge/chunks/node_modules_c5accc._.js:36145:15]
      [at file:///app/.next/server/app/edge/chunks/node_modules_c5accc._.js:36148:3]
      [at [project]/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/getHomeDir.js (ecmascript) (file:///app/.next/server/app/edge/chunks/node_modules_c5accc._.js:36166:3)]
      [at file:///app/.next/server/app/edge/chunks/app_api_listings_[[...key]]_route.ts_next-edge-bootstrap.ts_fc1fbe._.js:412:21]
      [at runModuleExecutionHooks (file:///app/.next/server/app/edge/chunks/app_api_listings_[[...key]]_route.ts_next-edge-bootstrap.ts_fc1fbe._.js:456:3)]
      [at instantiateModule (file:///app/.next/server/app/edge/chunks/app_api_listings_[[...key]]_route.ts_next-edge-bootstrap.ts_fc1fbe._.js:410:3)]
      [at getOrInstantiateModuleFromParent (file:///app/.next/server/app/edge/chunks/app_api_listings_[[...key]]_route.ts_next-edge-bootstrap.ts_fc1fbe._.js:498:10)]
      [at esmImport (file:///app/.next/server/app/edge/chunks/app_api_listings_[[...key]]_route.ts_next-edge-bootstrap.ts_fc1fbe._.js:181:18)]
      [at file:///app/.next/server/app/edge/chunks/node_modules_c5accc._.js:36363:175]
      [at [project]/node_modules/@aws-sdk/shared-ini-file-loader/dist-es/index.js (ecmascript) (file:///app/.next/server/app/edge/chunks/node_modules_c5accc._.js:36381:3)]

status: signal: 9 (SIGKILL)

https://github.com/aws/aws-sdk-js-v3/blob/1e806ba3f4a83c9e3eb0b41a3a7092da93826b8f/packages/shared-ini-file-loader/src/getHomeDir.ts#L1

not sure why

@ForsakenHarmony
Copy link
Contributor

This may be fixed with vercel/next.js#48791

it was just merged, so it's going to be in the next canary version (tonight)

@padmaia
Copy link
Member

padmaia commented May 2, 2023

@masterkain can you confirm if you're still seeing this with the latest canary?

@masterkain
Copy link
Author

masterkain commented May 3, 2023

@padmaia I got some other problems but I tried with a new project and routes appear to work, thanks

to be clear: the issue in the original ticket seems to be solved but I'm going to try again a more complex route handler with the aws sdk later today to check out if the mentioned vercel/next.js#48791 also works

@padmaia
Copy link
Member

padmaia commented May 10, 2023

Okay, closing this ticket out then. If you're still experiencing issues with a more complex route handler, let us know.

@padmaia padmaia closed this as completed May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working linear
Projects
None yet
Development

No branches or pull requests

6 participants