Review main Merged

92698[TASK] Throw exception when JavaScript module cannot be resolved

Himanshu Nitsan CR +2 V +2 Normal +52 −3 updated 02/06/26, 14:57

Commit message

When `ImportMap::resolveImport()` returns null for a module,
JavaScriptRenderer now throws an `UnexpectedValueException` including
the module name instead of a generic TypeError, so developers can
identify the missing or misconfigured module.

Review

  • Code review CR +2 Done
    • Benjamin Franzke +2
    • Markus Klein +1
    • Garvin Hicking +1
  • Verified V +2 Done
    • Benjamin Franzke +2
    • Garvin Hicking +1
    • core-ci +1 CI

Issues 1

Files 4

Review log 1521

  1. Himanshu Nitsan uploaded patch set 1 02/06/26, 05:40

  2. core-ci voted on patch set 1 V +1 02/06/26, 05:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95234

  3. Garvin Hicking updated the commit message in patch set 2 V +1 02/06/26, 06:10

  4. Garvin Hicking commented on patch set 2 02/06/26, 06:11

    Relabelled as task; I think this one is the patch we should keep and abandon the precededsor)
  5. core-ci voted on patch set 2 V +1 02/06/26, 06:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95235

  6. Georg Ringer voted on patch set 2 CR +1 02/06/26, 06:33

  7. Himanshu Nitsan commented on patch set 2 02/06/26, 07:03

    Reply

    I abandoned the duplicate patch.
  8. Himanshu Nitsan voted on patch set 2 CR +1 V +1 02/06/26, 07:04

  9. Benjamin Franzke commented on patch set 2 V -1 02/06/26, 07:16

    This does only handle `JavaScriptModuleInstruction` without `invoke()`, e.g. This properly throws: ``` $javaScriptRenderer->addJavaScriptModuleInstruction( JavaScriptModuleInstruction::create('@unavailable/foo/bar.js') ); ``` But this does not: ``` $javaScriptRenderer->addJavaScriptModuleInstruction( JavaScriptModuleInstruction::create('@unavailable/foo/bar.js')->invoke('foo') ); ``` Reason is because `JavaScriptModuleInstruction`s with dynamic instruction are resolved runtime by `@typo3/core/java-script-item-handler`.
  10. Benjamin Franzke commented on patch set 2 CR -1 02/06/26, 07:25

    I'm on it
  11. Benjamin Franzke uploaded patch set 3 CR +1 V +1 02/06/26, 07:34

  12. Benjamin Franzke commented on patch set 3 02/06/26, 07:34

    Reply

    Done
  13. Himanshu Nitsan commented on patch set 3 02/06/26, 07:38

    Reply

    Thanks for clarifying and adding the change.
  14. core-ci voted on patch set 3 V -1 02/06/26, 07:44 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95242

  15. core-ci commented on patch set 3 02/06/26, 07:52 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95242

  16. core-ci commented on patch set 3 02/06/26, 07:58 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95242

  17. core-ci voted on patch set 3 V +1 02/06/26, 08:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95242

  18. Markus Klein voted on patch set 3 CR +1 02/06/26, 09:13

  19. Garvin Hicking commented on patch set 3 CR +1 V +1 02/06/26, 09:56

    (Note, CI test reds were flakey and not related to this patch afaics)
  20. Benjamin Franzke voted on patch set 3 CR +2 V +2 02/06/26, 14:38

  21. Benjamin Franzke merged patch set 4 02/06/26, 14:57