Sveltekit on Cloudflare Pages Worker not working switching from Vercel

I get strange error when i replace following in svelte.config.js: import adapter from '@sveltejs/adapter-vercel'; with import adapter from "@sveltejs/adapter-cloudflare";
Run npm run preview to preview your production build locally.

> Using @sveltejs/adapter-cloudflare
✘ [ERROR] Could not resolve "http"

node_modules/.pnpm/nodemailer@6.9.8/node_modules/nodemailer/lib/fetch/index.js:3:21:
3 │ const http = require('http');
╵ ~~~~~~

The package "http" wasn't found on the file system but is built into node. Are you trying to
bundle for node? You can use "platform: 'node'" to do that, which will remove this error.

✘ [ERROR] Could not resolve "events"

node_modules/.pnpm/nodemailer@6.9.8/node_modules/nodemailer/lib/smtp-pool/index.js:3:29:
3 │ const EventEmitter = require('events');
╵ ~~~~~~~~
Run npm run preview to preview your production build locally.

> Using @sveltejs/adapter-cloudflare
✘ [ERROR] Could not resolve "http"

node_modules/.pnpm/nodemailer@6.9.8/node_modules/nodemailer/lib/fetch/index.js:3:21:
3 │ const http = require('http');
╵ ~~~~~~

The package "http" wasn't found on the file system but is built into node. Are you trying to
bundle for node? You can use "platform: 'node'" to do that, which will remove this error.

✘ [ERROR] Could not resolve "events"

node_modules/.pnpm/nodemailer@6.9.8/node_modules/nodemailer/lib/smtp-pool/index.js:3:29:
3 │ const EventEmitter = require('events');
╵ ~~~~~~~~
0 Replies
No replies yetBe the first to reply to this messageJoin