Bug #93227
closedRequirejs Loader does not work after Backend route change
100%
Description
If not logged in in backend mode, the requirejs loader is used to fetch configuration for non "public" extensions.
That means, invoking the following javascript on the backend login page will currently cause a 500 internal server error:
window.require(['TYPO3/CMS/Dashboard/Grid']);
(This is just an example, this could also be RsaAuth..)
Following error occurs:
requirejs-loader-04fc729459eefbea7c13b9ba7149b326.js:67 GET http://t3core-symlinked.localhost/typo3/ajax/core/requirejs&name=TYPO3%2FCMS%2FDashboard%2FGrid 500 (Internal Server Error)
Now, this happens because the URL is /typo3/ajax/core/requirejs&name but it should be /typo3/ajax/core/requirejs?name – otherwise no route will be found.
Furthermore requirejs error handling wasn't propagated in this case.
That means javascript that provided an errback method to requirejs is not executed:
window.require(['TYPO3/CMS/Dashboard/Grid'], (m) => console.log('not called because of wrong route'), (e) => {console.error('error propagated – not called because of missing error propagation: ' + e),console.log(e, e.originalError)})
Also, requiring an invalid module should cause the errback to be invoked:
window.require(['invalid-module'], (m) => console.log('will not be called'), (e) => {console.error('error propagated: ' + e),console.log(e, e.originalError)})
Expected output:
VM2882:1 error propagated: Error: requirejs fetchConfiguration for invalid-module failed [404] VM2882:1 Error: requirejs fetchConfiguration for invalid-module failed [404] at requirejs-loader-921bd94da48f0939a1e31eb77e919040.js:132 at XMLHttpRequest.xhr.onreadystatechange (requirejs-loader-921bd94da48f0939a1e31eb77e919040.js:60) Error: Not Found at XMLHttpRequest.xhr.onreadystatechange (requirejs-loader-921bd94da48f0939a1e31eb77e919040.js:60)
Actual output:
No, as no handler is invoked.