Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assets are not loading after installation #1500

Open
Hodzinek opened this issue Feb 19, 2024 · 5 comments
Open

assets are not loading after installation #1500

Hodzinek opened this issue Feb 19, 2024 · 5 comments

Comments

@Hodzinek
Copy link

Tried all the possibilities to install Symfony Demo (with symfony and composer) but when start Symfony Demo website, assets are not loaded.

Snímek obrazovky 2024-02-19 v 18 54 50
@davidhoelzel
Copy link

Seems like there is some syntax error in a "content.js" in your code.

But the sourcemaps error is apparent upon every fresh installation of the demo.

Sources get loaded, but sourcemaps are not.
This is a little bit annoying as there are dozens attempted to be loaded (from the vendor folder in project-root) and slow down local performance. As the sass-bundle always creates the compiled css with flag "--embed-source-map" when debug is enabled, there is no way to get rid of these errors but disabling debug.
But then you will run into another issue: the sourcemap is nevertheless embedded with "app.output.css.map", which can also not be found and results in another 404. But at least you can still use your scss without dozens of sourcemap errors.

scss compiled with debug disabled:
grafik

default sass-bundle build (debug enabled):
grafik

@javiereguiluz
Copy link
Member

We don't have any content.js asset in this project, right? If this is correct, maybe this comes from some browser extension?

@Hodzinek
Copy link
Author

I tried again, and when I choose to run:

  1. $ symfony serve
  • it works perfectly
  1. $ php -S localhost:8002 -t public/
  • the symfony demo does not work - the problem with assets as described
    Just to clarify the issues...

@UtechtDustin
Copy link

I can reproduce it with php -S localhost:8000 -t public, but works fine with php -S localhost:8000 public/index.php.
I'm not an expert for the build in php server (I'm using the symfony cli for dev), but i guess we have to pass the index.php as "router" script ?

But should the demo still "supports" the build in php server, as it was removed from the symfony documentation since 3.4 (symfony/symfony-docs#11567) ?

@morrisonlevi
Copy link

This is how I set this up now:

composer create-project symfony/symfony-demo==2.5.1 symfony-demo
echo "APP_ENV=prod" > symfony-demo/.env.local
cd symfony-demo
composer install
php bin/console asset-map:compile

Hopefully that helps someone. the key is php bin/console asset-map:compile, which I got from the asset mapper documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants