Issue Bug Closed

#107129xlf files breaks module "Maintenance -> Manage Language Packs"

Christian Hackl 07/23/25, 09:26 updated 07/23/25, 14:42

Description

I’m not quite sure how to describe this – here’s an attempt (with minimal example extension):

In the folder “my_ext/Resources/Private/Language/” are usually the XLF files for the static translations, so far so good, TYPO3 also finds them and they are used by TYPO3 without any problems.
If I now go to the Install Tool \-> Maintenance \-> Manage Language Packs in the BE, press the “Manage Language Packs” button <- nothing happens. Browser console spits out an invalid JSON error.
It doesn’t matter whether the “Language” folder contains a completely empty XLF or a filled XLF or even a 1-to-1 copy&paste XLF from the EXT:news … so as soon as there is anything in the “Language” folder (and only for this one extension – the Install-Tool -> “Manage Langauge Packs” module collapses.

The extension looks like this at the moment (really!):
NOT WORKING:
my_ext/composer.json
my_ext/ext_emconf.php
my_ext/Resources/Private/Language/ (here xlf files)

WORKING (deleted XLF-files):
my_ext/composer.json
my_ext/ext_emconf.php
my_ext/Resources/Private/Language/

Additional info:
Unfortunately, I can’t do much with the JSON error, as soon as I copy it out of the browser development tools and validate it with some tool, the JSON seems to be fine.
Tested in different TYPO3 13 versions incl. a completely new one without any third-party extensions. All “symlinked” / none-composer.

Background:
I only noticed this after a TYPO3 update from 11 – 13, with a single actually very very small extension, but I’m probably too stupid to find the difference to other extensions, which causes this problem.

Error Message:
Uncaught (in promise) SyntaxError: Unexpected token ‘’, “{“success”… is not valid JSON

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

Files 3

History 6

  1. Andreas Kienast commented and changed status New Accepted <span data-processor="relativetime" data-value="2025-07-23T10:13:09+00:00" > 07/23/25, 10:13 </span>

    Hi Christian.

    I can reproduce the issue in main, will investigate.

  2. Andreas Kienast commented <span data-processor="relativetime" data-value="2025-07-23T10:38:38+00:00" > 07/23/25, 10:38 </span>

    A quick update: the reason for the invalid JSON is that the response sent to the client contains a leading whitespace character. I’ll attempt to analyze further where it comes from.

  3. Andreas Kienast commented and changed attached Screenshot 2025-07-23 at 12.54.31.png <span data-processor="relativetime" data-value="2025-07-23T10:55:49+00:00" > 07/23/25, 10:55 </span>

    Hi Christian,

    it seems your ext_emconf.php file broken. The file contains an invisible whitespace character at the very beginning of the file, which will be sent to the output. Please see the attached screenshot.

    While this should be fixed anyway, you may solve this by creating a clean ext_emconf.php.

  4. Andreas Kienast commented <span data-processor="relativetime" data-value="2025-07-23T11:08:27+00:00" > 07/23/25, 11:08 </span>

    Addendum:

    ❯ xxd -l 10 ext_emconf.php
    00000000: efbb bf3c 3f70 6870 0a0a                 ...<?php..

    The culprit is the sequence ef bb bf, indicating a UTF-8 byte order mark. Please configure your editor properly to not include those.

  5. Christian Hackl commented <span data-processor="relativetime" data-value="2025-07-23T12:31:39+00:00" > 07/23/25, 12:31 </span>

    @afernandez
    Oh yes thank you! :)
    Stupid whitespace / invisible characters…
    And stupid me -> shure!: “cat” command, thank you! :D
    Linux for the rescue xD

    Solution for me:
    The file was saved as “UTF-8 with BOM” – save it as “UTF-8” without “BOM”

  6. Garvin Hicking commented and changed status Accepted Closed <span data-processor="relativetime" data-value="2025-07-23T14:42:27+00:00" > 07/23/25, 14:42 </span>

    Closing as fixed, thanks Andi :)