Skip to content
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

Running pnpm dev:prod results in linting/build errors #10840

Closed
coredevel opened this issue Jan 28, 2025 · 4 comments · Fixed by #10858
Closed

Running pnpm dev:prod results in linting/build errors #10840

coredevel opened this issue Jan 28, 2025 · 4 comments · Fixed by #10858
Assignees

Comments

@coredevel
Copy link

coredevel commented Jan 28, 2025

Describe the Bug

I'm trying to setup the 'website' template and a run production build, after running 'create-payload-app' to initialise the platform then running dev mode, navigating to admin for account setup and db seeding, which works fine. Later when running pnpm dev:prod it fails due to typescript issues:

   ▲ Next.js 15.1.6
   - Environments: .env
   - Experiments (use with caution):
     · turbo

   Creating an optimized production build ...
 ✓ Compiled successfully

./src/fields/defaultLexical.ts
36:33  Warning: Unexpected any. Specify a different type.  @typescript-eslint/no-explicit-any
36:47  Warning: Unexpected any. Specify a different type.  @typescript-eslint/no-explicit-any

./src/providers/Theme/InitTheme/index.tsx
8:5  Warning: Unused eslint-disable directive (no problems were reported from '@next/next/no-before-interactive-script-outside-document').

info  - Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/app/api-reference/config/eslint#disabling-rules
Failed to compile.

./src/blocks/Form/Component.tsx:35:5
Type error: Type 'FormFieldBlock[]' is not assignable to type 'AsyncDefaultValues<FormFieldBlock[]> | ({ blockName?: string | undefined; blockType?: "checkbox" | undefined; defaultValue?: boolean | undefined; label?: string | undefined; name?: string | undefined; required?: boolean | undefined; width?: number | undefined; } | ... 8 more ... | undefined)[] | undefined'.
  Type 'FormFieldBlock[]' is not assignable to type '({ blockName?: string | undefined; blockType?: "checkbox" | undefined; defaultValue?: boolean | undefined; label?: string | undefined; name?: string | undefined; required?: boolean | undefined; width?: number | undefined; } | ... 8 more ... | undefined)[]'.
    Type 'FormFieldBlock' is not assignable to type '{ blockName?: string | undefined; blockType?: "checkbox" | undefined; defaultValue?: boolean | undefined; label?: string | undefined; name?: string | undefined; required?: boolean | undefined; width?: number | undefined; } | ... 8 more ... | undefined'.
      Type 'MessageField' is not assignable to type '{ blockName?: string | undefined; blockType?: "checkbox" | undefined; defaultValue?: boolean | undefined; label?: string | undefined; name?: string | undefined; required?: boolean | undefined; width?: number | undefined; } | ... 8 more ... | undefined'.
        Type 'MessageField' is not assignable to type '{ blockName?: string | undefined; blockType?: "message" | undefined; message?: {} | undefined; }'.
          Types of property 'message' are incompatible.
            Type 'unknown' is not assignable to type '{} | undefined'.

  33 |
  34 |   const formMethods = useForm({
> 35 |     defaultValues: formFromProps.fields,
     |     ^
  36 |   })
  37 |   const {
  38 |     control,
Static worker exited with code: 1 and signal: null
 ELIFECYCLE  Command failed with exit code 1.
 ELIFECYCLE  Command failed with exit code 1.

Link to the code that reproduces this issue

No code

Reproduction Steps

Run pnpx create-payload-app
Select project template: website
Run in dev mode
Setup admin account & seed db
Navigate to frontend of site to ensure it's working properly
Stop dev mode
Run pnpm dev:prod

Which area(s) are affected? (Select all that apply)

area: templates

Environment Info

Docker compose environment:
  Container running node-lts:slim as the base image
  Database: MongoDB

Project template (on install): Website

Binaries:
  Node: 22.13.1
  npm: 10.9.2
  Yarn: 1.22.22
  pnpm: 9.15.4
Relevant Packages:
  payload: 3.19.0
  next: 15.1.6
  @payloadcms/db-mongodb: 3.19.0
  @payloadcms/email-nodemailer: 3.19.0
  @payloadcms/graphql: 3.19.0
  @payloadcms/live-preview: 3.19.0
  @payloadcms/live-preview-react: 3.19.0
  @payloadcms/next/utilities: 3.19.0
  @payloadcms/payload-cloud: 3.19.0
  @payloadcms/plugin-form-builder: 3.19.0
  @payloadcms/plugin-nested-docs: 3.19.0
  @payloadcms/plugin-redirects: 3.19.0
  @payloadcms/plugin-search: 3.19.0
  @payloadcms/plugin-seo: 3.19.0
  @payloadcms/richtext-lexical: 3.19.0
  @payloadcms/translations: 3.19.0
  @payloadcms/ui/shared: 3.19.0
  react: 19.0.0
  react-dom: 19.0.0
Operating System:
  Platform: linux
  Arch: x64
  Version: #52-Ubuntu SMP PREEMPT_DYNAMIC Thu Dec  5 13:09:44 UTC 2024
  Available memory (MB): 31493
  Available CPU cores: 16
@coredevel coredevel added status: needs-triage Possible bug which hasn't been reproduced yet validate-reproduction labels Jan 28, 2025
Copy link
Contributor

Please add a reproduction in order for us to be able to investigate.

Depending on the quality of reproduction steps, this issue may be closed if no reproduction is provided.

Why was this issue marked with the invalid-reproduction label?

To be able to investigate, we need access to a reproduction to identify what triggered the issue. We prefer a link to a public GitHub repository created with create-payload-app@beta -t blank or a forked/branched version of this repository with tests added (more info in the reproduction-guide).

To make sure the issue is resolved as quickly as possible, please make sure that the reproduction is as minimal as possible. This means that you should remove unnecessary code, files, and dependencies that do not contribute to the issue. Ensure your reproduction does not depend on secrets, 3rd party registries, private dependencies, or any other data that cannot be made public. Avoid a reproduction including a whole monorepo (unless relevant to the issue). The easier it is to reproduce the issue, the quicker we can help.

Please test your reproduction against the latest version of Payload to make sure your issue has not already been fixed.

I added a link, why was it still marked?

Ensure the link is pointing to a codebase that is accessible (e.g. not a private repository). "example.com", "n/a", "will add later", etc. are not acceptable links -- we need to see a public codebase. See the above section for accepted links.

Useful Resources

@AlessioGr AlessioGr added the status: verified If an issue has been reproduced label Jan 29, 2025
@AlessioGr AlessioGr self-assigned this Jan 29, 2025
@github-actions github-actions bot removed the status: needs-triage Possible bug which hasn't been reproduced yet label Jan 29, 2025
@github-actions github-actions bot removed the status: verified If an issue has been reproduced label Jan 29, 2025
Copy link
Contributor

🚀 This is included in version v3.20.0

@coredevel
Copy link
Author

Awesome

Copy link
Contributor

github-actions bot commented Feb 1, 2025

This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants