File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { createLexicalBlocksDiffComponent } from './plugin'
1+ import { createLexicalBlocksDiffComponent } from './plugin/createLexicalBlocksDiffComponent '
22
33/**
44 * Renders Lexical blocks in the admin version diff view. Every block in the
Original file line number Diff line number Diff line change @@ -15,7 +15,11 @@ bespoke layout.
1515` cms/src/shared/lexical/LexicalBlocksDiffComponent.tsx `
1616
1717``` tsx
18- import { createLexicalBlocksDiffComponent } from ' ./plugin'
18+ // Import the client component directly from its module — NOT from the `./plugin`
19+ // barrel. It pulls in `@payloadcms/ui` (which imports `.scss`), so re-exporting
20+ // it from the barrel would break `payload generate:types`/`generate:importmap`
21+ // (tsx can't load `.scss`). The barrel stays server-safe for the config graph.
22+ import { createLexicalBlocksDiffComponent } from ' ./plugin/createLexicalBlocksDiffComponent'
1923
2024export const LexicalBlocksDiffComponent = createLexicalBlocksDiffComponent ()
2125
@@ -83,7 +87,7 @@ export const blockOverrides = defineBlockConverters({
8387``` tsx
8488// LexicalBlocksDiffComponent.tsx
8589import { blockOverrides } from ' ./blockDiffConverters'
86- import { createLexicalBlocksDiffComponent } from ' ./plugin'
90+ import { createLexicalBlocksDiffComponent } from ' ./plugin/createLexicalBlocksDiffComponent '
8791
8892export const LexicalBlocksDiffComponent = createLexicalBlocksDiffComponent ({
8993 overrides: blockOverrides ,
Original file line number Diff line number Diff line change 11export { createAutoBlockConverter } from './autoBlockConverter'
2- export {
3- createLexicalBlocksDiffComponent ,
4- type CreateLexicalBlocksDiffComponentOptions ,
5- } from './createLexicalBlocksDiffComponent'
2+ // `createLexicalBlocksDiffComponent` is intentionally NOT re-exported here: it
3+ // pulls in `@payloadcms/ui` (which `import`s `.scss`), and this barrel is loaded
4+ // by the Payload config graph. `payload generate:types`/`generate:importmap`
5+ // load that graph through tsx, which cannot handle `.scss` and would throw
6+ // `ERR_UNKNOWN_FILE_EXTENSION`. Import it directly from its module instead (only
7+ // the Next-loaded diff component needs it — see ../LexicalBlocksDiffComponent).
8+ export type { CreateLexicalBlocksDiffComponentOptions } from './createLexicalBlocksDiffComponent'
69export {
710 blockContainer ,
811 coordinates ,
You can’t perform that action at this time.
0 commit comments