You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bug #50476 [FrameworkBundle] remove support for preloading ESM using headers (dunglas)
This PR was merged into the 6.3 branch.
Discussion
----------
[FrameworkBundle] remove support for preloading ESM using headers
| Q | A
| ------------- | ---
| Branch? | 6.3
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | n/a
| License | MIT
| Doc PR | n/a
Sorry to be that late on this one.
It looks like preloading ESM using HTTP headers (and so using 103 Early Hints) doesn't work, at least for now: WICG/import-maps#273 (comment)
ImportMap must be defined before downloading any ESM, and by definition HTTP headers are sent before importmap definition (it's currently not possible to define importmap using headers).
I don't know why I didn't caught this during my previous testing session, but now I get this error in the console when using this feature (which, according to the previously mentioned issue, is expected):
```
An import map is added after module script load was triggered.
Uncaught TypeError: Failed to resolve module specifier "app". Relative references must start with either "/", "./", or "../".
```
This patch simply removes this feature, which is entirely non-functional and misleading for the end user.
Commits
-------
7776c28 [FrameworkBundle] remove support for preloading ESM modules using headers
if (!$this->container->has('web_link.http_header_serializer')) {
418
416
thrownew \LogicException('You cannot use the "sendEarlyHints" method if the WebLink component is not available. Try running "composer require symfony/web-link".');
if (!$this->container->has('asset_mapper.importmap.manager')) {
427
-
thrownew \LogicException('You cannot use the JavaScript modules method if the AssetMapper component is not available. Try running "composer require symfony/asset-mapper".');
0 commit comments