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
Our team just installed and setup a very basic Payload 3.0 implementation. While dev/build works fine, we have been unsuccessful in getting types generated. We are running the following:
> web@0.1.0 payload:generate:types /Users/gregg/Code/web
> PAYLOAD_CONFIG_PATH=src/payload.config.ts payload generate:types
file:///Users/gregg/Code/web/node_modules/.pnpm/payload@3.0.0-beta.10_@swc+core@1.4.14_@swc+types@0.1.6/node_modules/payload/bin.js:3
import { register } from 'node:module'
^^^^^^^^
SyntaxError: The requested module 'node:module' does not provide an export named 'register'
payload.config.ts
import{postgresAdapter}from"@payloadcms/db-postgres"// import { payloadCloud } from '@payloadcms/plugin-cloud'import{lexicalEditor}from"@payloadcms/richtext-lexical"// editor-importimportpathfrom"path"import{buildConfig}from"payload/config"// import sharp from 'sharp'import{fileURLToPath}from"url"import{PayloadCollections}from"./collections"import{usersCollection}from"./collections/users/users-new"constfilename=fileURLToPath(import.meta.url)constdirname=path.dirname(filename)exportdefaultbuildConfig({admin: {user: usersCollection.slug,},collections: PayloadCollections,editor: lexicalEditor({}),// plugins: [payloadCloud()], // TODO: Re-enable when cloud supports 3.0secret: process.env.PAYLOAD_SECRET||"",typescript: {outputFile: path.resolve(dirname,"payload-types.ts"),},db: postgresAdapter({pool: {connectionString: process.env.PAYLOAD_DATABASE_URI||"",},}),// Sharp is now an optional dependency -// if you want to resize images, crop, set focal point, etc.// make sure to install it and pass it to the config.// This is temporary - we may make an adapter pattern// for this before reaching 3.0 stable// sharp,})
To Reproduce
Install payload@3.0.0-beta.10 into an existing NextJS 14 application
Add the script: "payload:generate:types": "PAYLOAD_CONFIG_PATH=src/payload.config.ts payload generate:types", to package.json.
Run pnpm payload:generate:types
Payload Version
3.0.0-beta.10
Adapters and Plugins
db-postgres
The text was updated successfully, but these errors were encountered:
I just ran into the same issue, but for an export from one of the other packages in my monorepo.
import { SketchPicker } from "react-color";
^^^^^^^^^^^^
SyntaxError: The requested module 'react-color' does not provide an export named 'SketchPicker'
However, this export does exist and the app builds without issue. Using Node 22.1.0 and Payload 3.0.0-beta.23.
Link to reproduction
No response
Describe the Bug
Our team just installed and setup a very basic Payload 3.0 implementation. While dev/build works fine, we have been unsuccessful in getting types generated. We are running the following:
version: 3.0.0-beta.10
command: PAYLOAD_CONFIG_PATH=src/payload.config.ts payload generate:types
Error:
payload.config.ts
To Reproduce
"payload:generate:types": "PAYLOAD_CONFIG_PATH=src/payload.config.ts payload generate:types",
topackage.json
.pnpm payload:generate:types
Payload Version
3.0.0-beta.10
Adapters and Plugins
db-postgres
The text was updated successfully, but these errors were encountered: