You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am stoked that with yesterdays release of Deno v2 it is now possible to create and run Payload natively in Deno!
$ deno run -A npm:create-payload-app@beta
$ deno run dev
Task dev cross-env NODE_OPTIONS=--no-deprecation next dev
▲ Next.js 15.0.0-canary.173
- Local: http://localhost:3000
- Environments: .env
- Experiments (use with caution):
· turbo
✓ Starting...
✓ Ready in 1775ms
○ Compiling /admin/[[...segments]] ...
✓ Compiled /admin/[[...segments]] in 9.7s (3745 modules)
I just ran into a problem running my standalone DB seed script that fails due to an invalid module import on import config from '@payload-config'. I am using the code from the docs on using payload outside Next.js. I know that Deno is not officially supported by Next/Payload and this is probably a problem in Deno. But I was wondering if anyone knows if there is another way to import payload in plain typescript that also works in Deno? That would be awesome!
seed.ts:
// We are importing `getPayload` because we don't need HMR// for a standalone script. For usage of Payload inside Next.js,// you should always use `import { getPayloadHMR } from '@payloadcms/next/utilities'` instead.import{BasePayload,getPayload}from'payload'importconfigfrom'@payload-config'constpayload: BasePayload=awaitgetPayload({ config })// Get a local copy of Payload by passing your configprocess.exit(0)
deno run:
$ deno run src/seed/seed.ts
error: [ERR_INVALID_MODULE_SPECIFIER] Invalid module '@payload-config' is not a valid package name imported from '.../my-app/src/seed/seed.ts'
at file://.../my-app/src/seed/seed.ts:5:20
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am stoked that with yesterdays release of Deno v2 it is now possible to create and run Payload natively in Deno!
I just ran into a problem running my standalone DB seed script that fails due to an invalid module import on
import config from '@payload-config'
. I am using the code from the docs on using payload outside Next.js. I know that Deno is not officially supported by Next/Payload and this is probably a problem in Deno. But I was wondering if anyone knows if there is another way to import payload in plain typescript that also works in Deno? That would be awesome!seed.ts
:deno run:
Beta Was this translation helpful? Give feedback.
All reactions