denoland / deploy_feedback

For reporting issues with Deno Deploy
https://deno.com/deploy
74 stars 5 forks source link

[Bug]: Does not function on Deno Deploy but functions when running locally #680

Closed uptownhr closed 2 months ago

uptownhr commented 3 months ago

Problem description

Here is the repo that is resulting in a different behavior when I run locally vs when ran in deno cloud.

My Github Project: Zap

Steps to reproduce

Local STR

  1. clone
  2. deno task dev
  3. visit http://localhost:3000/ Expected Behavior: you'll see an empty array as your response and not a 500

Deno Cloud

  1. clone
  2. deployctl deploy
  3. visit the auto-generated deno url

Expected behavior

Expected Behavior: empty array Actual Behavior: I see a 500 error in the Deno Cloud Runtime. Error log from Deno Cloud below.

Environment

Version: Deno 1.44.0 OS: OSX

Possible solution

No response

Additional context

Logs from Deno Cloud deployment of error


    at async file:///node_modules/.deno/@nestjs+core@10.3.9/node_modules/@nestjs/core/router/router-proxy.js:9:17
6/20/2024, 8:59:58 PM
gcp-us-west2
    at async file:///node_modules/.deno/@nestjs+core@10.3.9/node_modules/@nestjs/core/router/router-execution-context.js:46:28
6/20/2024, 8:59:58 PM
gcp-us-west2
    at eventLoopTick (ext:core/01_core.js:175:21)
6/20/2024, 8:59:58 PM
gcp-us-west2
    at runNextTicks (ext:deno_node/_next_tick.ts:71:3)
6/20/2024, 8:59:58 PM
gcp-us-west2
    at processTicksAndRejections (ext:deno_node/_next_tick.ts:53:10)
6/20/2024, 8:59:58 PM
gcp-us-west2
    at Object.runMicrotasks (ext:core/01_core.js:642:26)
6/20/2024, 8:59:58 PM
gcp-us-west2
    at file:///node_modules/.deno/@nestjs+core@10.3.9/node_modules/@nestjs/core/router/router-execution-context.js:38:29
6/20/2024, 8:59:58 PM
gcp-us-west2
    at RedirectController.create (file:///src/controller.ts:30:30)
6/20/2024, 8:59:58 PM
gcp-us-west2
TypeError: Cannot read properties of undefined (reading 'create')
6/20/2024, 8:59:58 PM
gcp-us-west2
[Nest] 2  - 06/21/2024, 3:59:58 AM   ERROR [ExceptionsHandler] Cannot read properties of undefined (reading 'create')
6/20/2024, 8:59:58 PM
uptownhr commented 3 months ago

I wonder if this is related to https://github.com/denoland/deno/issues/19160#issuecomment-1949548670

magurotuna commented 3 months ago

Hi @uptownhr thanks for reporting with very clear and concise code repository. We are looking into it, but as you guessed this looks related to decorator processing in Deno Deploy. We will get back to you once we figure out something.

magurotuna commented 2 months ago

@uptownhr We've identified the root cause. NestJS requires emitDecoratorMetadata to be enabled in the compiler options, which Deno CLI handles correctly but Deno Deploy doesn't. We've fixed this issue in Deno Deploy and this will be shipping within the next few days.