Closed
Description
Describe the Bug
When using nested blocks, v3.39.0
+ fails build with
Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
TypeError: Cannot read properties of undefined (reading 'columns')
v3.38
and before have no issues.
Important bits in the reproduction:
-
The nested block:
https://github.com/lunacd/romantic-austin/blob/a5bea92878a331809d664eb3ecc513cd00ca56df/collections/NestedBlock.ts#L1-L16 -
A collection that uses the nested block:
https://github.com/lunacd/romantic-austin/blob/de1122eaaaee4a623b801095ddd106bfa30bd48c/collections/Collection.ts#L10 -
Use the collection in any manner:
https://github.com/lunacd/romantic-austin/blob/de1122eaaaee4a623b801095ddd106bfa30bd48c/app/(app)/page.tsx#L8-L10
If:
- the block is not nested (see https://github.com/lunacd/romantic-austin/blob/de1122eaaaee4a623b801095ddd106bfa30bd48c/collections/Collection.ts#L11-L12), OR
- the block is not used (delete https://github.com/lunacd/romantic-austin/blob/de1122eaaaee4a623b801095ddd106bfa30bd48c/app/(app)/page.tsx#L8-L10), OR
- payload
v3.38
is used instead
This issue does not happen.
Link to the code that reproduces this issue
https://github.com/lunacd/romantic-austin
https://codesandbox.io/p/github/lunacd/romantic-austin/main
Reproduction Steps
Run pnpm i && pnpm run build
.
Which area(s) are affected? (Select all that apply)
Not sure
Environment Info
Binaries:
Node: 20.12.0
npm: 10.5.0
Yarn: 1.22.19
pnpm: 8.15.6
Relevant Packages:
payload: 3.40.0
next: 15.2.0
@payloadcms/graphql: 3.40.0
@payloadcms/next/utilities: 3.40.0
@payloadcms/richtext-lexical: 3.40.0
@payloadcms/translations: 3.40.0
@payloadcms/ui/shared: 3.40.0
react: 19.0.0
react-dom: 19.0.0
Operating System:
Platform: linux
Arch: x64
Version: #1 SMP PREEMPT_DYNAMIC Sun Aug 6 20:05:33 UTC 2023
Available memory (MB): 4102
Available CPU cores: 2
Metadata
Metadata
Assignees
Labels
No labels