0

I can't deploy a project on deno deploy that uses the mongoose module.

I am trying to connect to a mongo database in a project that uses the fresh framework and I used mongoose to do so by using

import mongoose from "npm:mongoose@^6.7";

in my 'main.ts' file.

When I run the project locally there is no problem but when I push the changes to to GitHub the project can't be deployed on deno deploy because the mongoose module can't be found.

What is the correct way to use that module so the project can be deployed?

  • 1
    Deno Deploy does not support `npm:` specifiers yet: https://discord.com/channels/684898665143206084/826085979344470037/1042076110407606283. I believe support is expected around February 2023: https://discord.com/channels/684898665143206084/826085979344470037/1042271619680321566 – Zwiers Nov 27 '22 at 14:32
  • @Zwiers Thank you very much! Do you know any other way to connect to the database that deno deploy supports or should I just host the application somewhere else and if so any idea where to would be very helpful. – Bill Kalaitzo Nov 27 '22 at 16:25
  • I haven't tried it myself but you should be able to use MongoDB Atlas with the [deno MongoDB driver](https://deno.land/x/mongo@v0.31.1). Otherwise you could use a different database like Postgres, there's some tutorials in the [Deploy docs](https://deno.com/deploy/docs) – Zwiers Nov 27 '22 at 18:03

0 Answers0