core icon indicating copy to clipboard operation
core copied to clipboard

Asset mapper warnings

Open zorn-v opened this issue 1 year ago • 9 comments

API Platform version(s) affected: 3.3.3

Description

00:29:59 WARNING   [asset_mapper] Unable to find asset "./path/to/domAnimations" imported from "/var/www/html/vendor/api-platform/core/src/Symfony/Bundle/Resources/public/graphiql/graphiql.min.js".
00:30:00 WARNING   [asset_mapper] Unable to find asset "./files/open-sans-hebrew-700-normal.woff2" referenced in "/var/www/html/vendor/api-platform/core/src/Symfony/Bundle/Resources/public/fonts/open-sans/700.css". The file "/var/www/html/vendor/api-platform/core/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-hebrew-700-normal.woff2" does not exist.
00:30:00 WARNING   [asset_mapper] Unable to find asset "./files/open-sans-hebrew-400-normal.woff2" referenced in "/var/www/html/vendor/api-platform/core/src/Symfony/Bundle/Resources/public/fonts/open-sans/400.css". The file "/var/www/html/vendor/api-platform/core/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-hebrew-400-normal.woff2" does not exist.

How to reproduce

With symfony/flex run

composer req api asset-mapper
./bin/console asset-map:compile

Possible Solution

Put that font files or remove its definitions. About "./path/to/domAnimations" - it is in comment and known behavior of asset mapper https://symfony.com/doc/current/frontend/asset_mapper.html#missing-asset-warnings-on-commented-out-code BUT, graphiql.min.js is not looks like "min" version but "debug" version with 3,0M (!!!) file size.

Additional Context

It does not harm anything, just annoying

zorn-v avatar May 20 '24 14:05 zorn-v

https://github.com/graphql/graphiql/blob/fa0e7f7a141d10a78e8773cf723781e265fba470/packages/graphiql/resources/build.sh#L16 :/ we do copy this one I'm not a huge fan of having these files inside api platform but we don't have an alternative sadly.

soyuka avatar May 31 '24 08:05 soyuka

Yeah, seems a bug in some build pipeline for graphiql https://www.npmjs.com/package/graphiql?activeTab=code

"min" file have same size and definitely not minimized and have debug strings in it

zorn-v avatar Jun 01 '24 00:06 zorn-v

What about missing files ?

zorn-v avatar Jun 11 '24 15:06 zorn-v

I am facing same issue :) any updates?

latheva avatar Jun 11 '24 23:06 latheva

I updated the assets at https://github.com/api-platform/core/pull/6400 I had no more errors do you still see some? Maybe that I need to update the distribution to be in sync?

soyuka avatar Jun 13 '24 06:06 soyuka

--no-debug option does save me temporarily

php bin/console asset-map:compile --no-debug

latheva avatar Jun 13 '24 08:06 latheva

I updated the assets at #6400 I had no more errors do you still see some?

There are still warnings in 3.3.5

zorn-v avatar Jun 13 '24 09:06 zorn-v

I see warnings but the file exist at https://github.com/api-platform/core/blob/3.3/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-hebrew-400-normal.woff2

soyuka avatar Jun 13 '24 14:06 soyuka

But not exist at https://github.com/api-platform/core/blob/v3.3.5/src/Symfony/Bundle/Resources/public/fonts/open-sans/files/open-sans-hebrew-400-normal.woff2 :wink:

I see update, thanks. Those warnings about missing files gone in 3.3.6

zorn-v avatar Jun 14 '24 09:06 zorn-v

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 14 '24 00:08 stale[bot]

Hi! I'm facing with same problem. I upgraded api-platform/core to 3.4.7 but still not working when i run php bin/console asset-map:compile

antonio-valerio avatar Nov 22 '24 15:11 antonio-valerio

I added a PR in that should solve the problem, it's because of a javascript file that's actually inside a comment.

https://github.com/symfony/symfony/pull/58944

tacman avatar Nov 22 '24 16:11 tacman