Fekide / strapi-plugin-translate

Strapi plugin for automated translations using different Translate Providers
https://market.strapi.io/plugins/strapi-plugin-translate
MIT License
55 stars 21 forks source link

[BUG]: Cannot read properties of null (reading '__component') #472

Open bkrajewski94 opened 11 hours ago

bkrajewski94 commented 11 hours ago

Describe the bug I see an error Cannot read properties of null (reading '__component') when I try to translate pages and components after upgrading to 1.2.6

To Reproduce Not sure what it's caused by, I just hit the translate button and try to retranslate, the way I did on 1.2.5. I see an error:

main.1ecca1de.js:1211 TypeError: Cannot read properties of null (reading '__component')
    at xe (main.1ecca1de.js:1200:9807)
    at main.1ecca1de.js:1200:10180
    at Array.forEach (<anonymous>)
    at xe (main.1ecca1de.js:1200:9977)
    at main.1ecca1de.js:1200:10292
    at Array.map (<anonymous>)
    at main.1ecca1de.js:1200:10279
    at Array.forEach (<anonymous>)
    at xe (main.1ecca1de.js:1200:9977)
    at _n (main.1ecca1de.js:1211:1677)

Screenshots Source code of error in the console: image

System (please complete the following information):

Plugin config

  translate: {
    enabled: true,
    config: {
      translatedFieldTypes: [
        { type: 'string', format: 'plain' },
        { type: 'text', format: 'plain' },
        { type: 'richtext', format: 'html' },
        'component',
        'dynamiczone',
      ],
      provider: 'deepl',
      providerOptions: {
        apiKey: env('DEEPL_API_KEY'),
        localeMap: {
          EN: 'EN-US',
        },
        apiOptions: {
          formality: 'default',
        },
      },
    },
  },

Additional context My data is deeply nested (more than 2 levels)

bkrajewski94 commented 11 hours ago

Based on the commit and the source code in the browser I think that the bug is here: image