angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Karma runner logs warning for public assets

Open CrisGrec opened this issue 10 years ago • 3 comments

The karma.conf.js currently proxies requests as follows: '/app/': '/base/dist/app/'.

However if you put an asset such as an image in the public directory, the asset is placed into the root of the dist directory when built. The result is that karma will log a warning each time the asset is requested:

19 04 2016 23:34:57.334:WARN [web-server]: 404: /image.png

Not sure if it's a valid solution, but changing the proxy to '/': '/base/dist/' allows requests to app to behave as normal, while including requests to assets in the root of dist, eliminating the warnings.

CrisGrec avatar Apr 19 '16 22:04 CrisGrec

I'll put up a PR with your fix. If it horribly breaks everything, our tests should be able to show since they run ng test a whole lotta times.

filipesilva avatar Apr 21 '16 11:04 filipesilva

Seems fine really, it's in!

filipesilva avatar Apr 21 '16 12:04 filipesilva

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.