3

I've installed the latest Sylius-Standard (based on Sylius 1.0@dev) and followed the quick tutorial. Everything is working fine except the admin panel, where CSS and JS return 500 when accessed in dev mode (via app_dev.php).

demo

I can see that they are fetched from a path that does not include app_dev.php. For instance, app.js is fetched from http://my.local.domain/assets/admin/js/app.js, which returns a 500 because it tries to access the prod database that is not setup.

There should be no need to create the prod database or install prod assets to access the admin panel in dev mode — what am I doing wrong?

leonheess
  • 5,825
  • 6
  • 42
  • 67
tchap
  • 3,334
  • 2
  • 24
  • 43
  • put your .htaccess content – Mojtaba Aug 18 '16 at 13:28
  • Well I haven't changed it from the Sylius-Standard repo, but I don't think that changes anything anyway – tchap Aug 18 '16 at 13:32
  • What kind of web server do you use? – Mojtaba Aug 18 '16 at 13:46
  • I too am having this problem with a fresh install of sylius-standard. Tried gulp & assets:install – beterthanlife Aug 26 '16 at 09:59
  • I had the same problem when i first installed it, i made an issue in github and they said it was fixed. I can't find my original issue though. You shouldn't need to run npm install but at this stage you do. Can you create another issue in the Syslius Standard repo - https://github.com/Sylius/Sylius-Standard – Brett Aug 29 '16 at 23:20
  • Vote on [this proposal](https://meta.stackoverflow.com/questions/354583/disentangle-the-yarn) to ease the tag confusion. – leonheess Feb 10 '20 at 12:36

2 Answers2

1

Sylius use a gulp library to manage css and js. The following command should fix your problem:

$ npm install
$ npm run gulp

Edit

After a few years, this is the proper answer: https://stackoverflow.com/a/59135635/4243630

lchrusciel
  • 351
  • 1
  • 5
  • Sylius, yes, but it is not required for Sylius-Standard, and was working in the previous versions. Besides, it should not call the prod database in dev – tchap Aug 18 '16 at 13:49
  • `yarn install` and `yarn build` sorts out that problem. Thanks for the hint. We are on Sylius 1.2.x – Roydon D' Souza Dec 02 '19 at 09:00
1

In order to see a fully functional frontend you will need to install its assets.

Sylius uses Gulp to build frontend assets using Yarn as a JavaScript package manager.

Having Yarn installed, go to your project directory to install the dependencies:

$ yarn install

Then build the frontend assets by running:

$ yarn build

We are on Sylius 1.2.x, we followed the official documentation

This sorted out that problem for us.

If you are on 1.x this is the link to the documentation

This should solve your problem.

Roydon D' Souza
  • 415
  • 1
  • 7
  • 22