Closed jnthnclrk closed 1 year ago
You'll probably need to bundle your worker code before depoying it to Cloudflare. Are you using Wrangler to deploy your worker?
Right, so you can't just key import statements into the CF UI?
Probably not. It would not resolve dependencies from NPM. I'd reccomend following the Getting Started Guide on developing with the wrangler CLI.
Thanks @TimoWilhelm. Indeed — to import npm packages, you need to be bundling your functions with wrangler
.
Noob question…
I'm prob doing this wrong, but why won't my Cloudflare worker recognise this Neon module? I connected Neon no probs using the integration option…
import { Client } from '@neondatabase/serverless';
This import line is reference in a lot of CF worker Neon docs: https://developers.cloudflare.com/workers/databases/native-integrations/neon/