-
Notifications
You must be signed in to change notification settings - Fork 23
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
Error when i use mongo with the build #40
Comments
Can you show me your complete code for the API endpoint? |
//app.ts
import { opine } from "https://deno.land/x/[email protected]/mod.ts";
import { MongoClient } from "https://deno.land/x/[email protected]/mod.ts";
const client = new MongoClient();
client.connectWithUri("URL");
const db = client.database("NAME");
const users = db.collection<any>("COLLECTION");
const app = opine();
app.use(async (req, res) => {
res.json(
await users.find({ name: { $ne: null } })
)
});
app.listen();
export default app vercel.json
{
"builds" : [
{"src" : "*.ts", "use" : "[email protected]"}
],
"build": {
"env": {
"DENO_UNSTABLE" : "true"
}
}
} #bash
>vc dev
error: Uncaught ReferenceError: default is not defined
const handler = mod.default;
^
at dev-server.ts:12:21 |
Thanks for that. I've distilled the issue down to a bug in deno. See denoland/deno#7649. |
This was fixed in Deno v1.4.5, which is the default version in |
There's an error says |
Can you try |
Are you setting the |
Looks like the mongo dependency is trying to write to the filesystem. In the serverless function environment, the filesystem is read-only, except for the |
Btw the issue with using |
I'm trying to deploy simple api (deno - opine - mongo),
I get
when i use mongo module from https://deno.land/x/[email protected]
The text was updated successfully, but these errors were encountered: