fix(next): admin panel fails compiling when fullySpecified is set in next config (#11531)

If `experimental.fullySpecified` is set to `true` in the next config, the Payload admin panel fails to compile, throwing the following error:

```ts
Failed to compile.

../../node_modules/.pnpm/@payloadcms+next@3.25.0-canary.46647b4_@types+react@18.3.1_graphql@16.10.0_monaco-editor@0.40_w3ro7ziou6gzev7zbe3qqrwaqe/node_modules/@payloadcms/next/dist/views/Version/RenderFieldsToDiff/fields/Select/DiffViewer/index.js
Attempted import error: 'DiffMethod' is not exported from 'react-diff-viewer-continued' (imported as 'DiffMethod').
```

The issue stems from incorrect import statements in `react-diff-viewer-continued` 4.0.4. This was fixed in `react-diff-viewer-continued` 4.0.5.

This PR also enables `fullySpecified` in our test suites, to catch these issues going forward.
This commit is contained in:
Alessio Gravili
2025-03-04 17:04:03 -07:00
committed by GitHub
parent 64b63f6833
commit cc05937633
6 changed files with 13 additions and 11 deletions

View File

@@ -29,7 +29,7 @@ const ConditionalLogic: CollectionConfig = {
type: 'text',
admin: {
components: {
Field: '/collections/ConditionalLogic/CustomFieldWithField',
Field: '/collections/ConditionalLogic/CustomFieldWithField.js',
},
condition: ({ toggleField }) => Boolean(toggleField),
},
@@ -40,7 +40,7 @@ const ConditionalLogic: CollectionConfig = {
type: 'text',
admin: {
components: {
Field: '/collections/ConditionalLogic/CustomFieldWithHOC',
Field: '/collections/ConditionalLogic/CustomFieldWithHOC.js',
},
condition: ({ toggleField }) => Boolean(toggleField),
},
@@ -50,7 +50,7 @@ const ConditionalLogic: CollectionConfig = {
type: 'text',
admin: {
components: {
Field: '/collections/ConditionalLogic/CustomClientField',
Field: '/collections/ConditionalLogic/CustomClientField.js',
},
condition: ({ toggleField }) => Boolean(toggleField),
},
@@ -60,7 +60,7 @@ const ConditionalLogic: CollectionConfig = {
type: 'text',
admin: {
components: {
Field: '/collections/ConditionalLogic/CustomServerField',
Field: '/collections/ConditionalLogic/CustomServerField.js',
},
condition: ({ toggleField }) => Boolean(toggleField),
},

View File

@@ -72,7 +72,7 @@ const JSON: CollectionConfig = {
type: 'json',
admin: {
components: {
afterInput: ['./collections/JSON/AfterField#AfterField'],
afterInput: ['./collections/JSON/AfterField.js#AfterField'],
},
},
label: 'Custom Json',

View File

@@ -20,6 +20,7 @@ export default withBundleAnalyzer(
ignoreBuildErrors: true,
},
experimental: {
fullySpecified: true,
serverActions: {
bodySizeLimit: '5mb',
},