r1tsuu / payload-enchants

Payload 3.0 enchantment packages
MIT License
118 stars 7 forks source link

docs-reorder: Crash when no `i18n` specified in `payload.config.ts` #90

Open tyteen4a03 opened 1 month ago

tyteen4a03 commented 1 month ago

Error:

 ⨯ node_modules/deepmerge/dist/cjs.js (61:1) @ getKeys
 ⨯ unhandledRejection: TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at getKeys (webpack-internal:///(rsc)/./node_modules/deepmerge/dist/cjs.js:61:16)
    at mergeObject (webpack-internal:///(rsc)/./node_modules/deepmerge/dist/cjs.js:86:2)
    at deepmerge (webpack-internal:///(rsc)/./node_modules/deepmerge/dist/cjs.js:117:10)
    at eval (webpack-internal:///(rsc)/./node_modules/@payload-enchants/docs-reorder/dist/index.js:40:20)
    at eval (webpack-internal:///(rsc)/./node_modules/payload/dist/config/build.js:15:20)
    at async buildConfig (webpack-internal:///(rsc)/./node_modules/payload/dist/config/build.js:13:36)

Reproduction: Make sure there is no i18n section in your payload.config.ts.

Adding this back into payload.config.ts should make the error disappear:

    i18n: {
        translations: {},
    },
r1tsuu commented 1 month ago

I haven't tried beta 63+ with any of my plugins, there definetely were some breaking changes, so I'll need to go through each and fix those

r1tsuu commented 1 month ago

opened a draft PR https://github.com/r1tsuu/payload-enchants/pull/91