'Deno.exit' is not allowed in this context.
Locally I can do in a nest project
npm run build
deno run -A .enviroment/deploy.ts
and it works correctly, but when I upload it to deno deploy, it gives me this error:
PermissionDenied: 'Deno.exit' is not allowed in this context.
My deploy.yml
3 Replies
I wasn't able to find the answer to your question in the official Deno documentation. However, based on the error message you've provided, it seems like there might be an issue with the way imports are being resolved in your code.
The error message
Relative import path "@nestjs/core" not prefixed with / or ./ or ../
suggests that the import statement for @nestjs/core
might not be compatible with Deno's module resolution. Deno requires that all imports from local files are relative paths (starting with ./
or ../
) or absolute paths (starting with /
). Since @nestjs/core
looks like a package name rather than a local file, this might be causing the issue.
Please note that this advice is not based on the Deno documentation, and I would advise you to double-check the accuracy of the advice given. It's also worth noting that NestJS is typically associated with the Node.js ecosystem, and Deno has a different set of standards for modules and third-party packages. If you're trying to deploy a NestJS application on Deno Deploy, you may need to ensure that all your dependencies and import statements are compatible with Deno's import resolution.@Sheik The
Deno.exit
method is not available on Deno Deploy. Only the following Deno.*
APIs are present https://docs.deno.com/deploy/api#deno-apis
Deno Deploy is a serverless platform, so the v8 isolate will shut down automatically after no requests have been received for a while