Skip to content

Commit 3865de3

Browse files
committed
minor #19565 [AssetMapper] Adding infos to be forwarded to package maintainers in case of error (ThomasLandauer)
This PR was merged into the 6.4 branch. Discussion ---------- [AssetMapper] Adding infos to be forwarded to package maintainers in case of error Page: https://symfony.com/doc/6.4/frontend/asset_mapper.html#importing-3rd-party-javascript-packages Closes #19558 Thanks to `@tofsjonas` for figuring this out at tofsjonas/sortable#68 You might say it's not the job of the Symfony docs to tell JavaScript package maintainers how to set up their packages. But: With so many packages out there, I doubt that importing them will *always* work. So instead of leaving Symfony users back frustrated, I think it's better to tell them what they can do. And that it's not AssetMapper's fault that it didn't work out. Commits ------- c9b28f5 [AssetMapper] Adding infos to be forwarded to package maintainers in case of error
2 parents 72ea8fd + c9b28f5 commit 3865de3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

frontend/asset_mapper.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,11 @@ to add any `npm package`_:
188188
189189
$ php bin/console importmap:require bootstrap
190190
191+
.. note::
192+
193+
If you're getting a 404 error, you can contact the package maintainer and ask them to
194+
include `"main":` and `"module":` to the package's `package.json`.
195+
191196
This adds the ``bootstrap`` package to your ``importmap.php`` file::
192197

193198
// importmap.php
@@ -207,6 +212,8 @@ This adds the ``bootstrap`` package to your ``importmap.php`` file::
207212
such as ``@popperjs/core``. The ``importmap:require`` command will add both the
208213
main package *and* its dependencies. If a package includes a main CSS file,
209214
that will also be added (see :ref:`Handling 3rd-Party CSS <asset-mapper-3rd-party-css>`).
215+
If the associated CSS file isn't added to the importmap, you can contact the package
216+
maintainer and ask them to include `"style":` to the package's `package.json`.
210217

211218
Now you can import the ``bootstrap`` package like usual:
212219

0 commit comments

Comments
 (0)