Skip to content

Dev mode for assetmapper does not serve css files automatically #54520

@cooldude77

Description

@cooldude77

Symfony version(s) affected

6.3.12, 7.0.6

Description

Hello Helping folks,

I am coding my app with version 7.0.6 and saw asset mapper being used for delivering CSS.
I added app.css as mentioned in the assets folder of the project.

I am running a simple installation of apache2, php 8.3, mariadb on Ubuntu environment on virtual box

As mentioned here , the assets should be delivered to the web page using an inbuilt controller if the APP_ENV=dev and I don't have to compile them.

Unfortunately, I do not see the assets being delivered to web page in dev environment.

To mitigate it , I compiled the assets ( shouldn't need to ) in dev environment and files were added to my public folder.

I thought maybe I am not doing something correct so I purchased the course given at symfonycast in dev environment but to no luck.

What am I doing wrong here? or is some step missing?
image

Thanks a lot.

How to reproduce

Create any symfony project where asset mapper can be used ( please use dev mode)
Install symfony
Update/create assets/style/app.css and then change some values in css.
The css is not reflected on page load and the upon clicking the js file leads to 404 ( because it is not in public folder)

Possible Solution

Update:
Just found out after lot of debugging and researching, this only works good when we are using symfony local server run using command
symfony server:start
Is there anyway to run it using configurations above( using apache) ?

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions