denodeno-deploy

TypeError: Deno.run is not a function


My project works perfectly fine locally, but when I deploy the project on deno.dev it crashes.

TypeError: Deno.run is not a function
    at build (file:///src/scripts/build.ts:2:26)
    at file:///src/server/main.ts:3:7

When my project runs for the first time, I attempt to create a sub process, using Deno.run

Is runfrom the Deno API not available on deno deploy?


Solution

  • Deno.run is not available on Deno deploy. You can see all available APIs in the following link:

    Aside from Deno.run there are several APIs not currently available, including all unstable APIs.


    From Deno deploy issues: https://github.com/denoland/deploy_feedback/issues/288

    It is our intention that all stable APIs in Deno will exist in Deno Deploy too, in the limit. A user calling Deno.run() on Deno Deploy and receiving an error such as PermissionDenied: running subprocesses is not permitted in this context has a much better experience than a user that receives: TypeError: undefined is not a function (calling Deno.run).