Installation via composer on Windows 10 - missing CSS?

<%- if @topic_view.topic.tags.present? %>
<%= t 'js.tagging.tags' %>: <%- @topic_view.topic.tags.each do |t| %> <%= t %> <%- end %>
<% end %>

Silverstripe Version: 4.2.1

Question: Why are the CSS and JS files missing?

I’ve installed 4.2.1 using composer, with no errors during the installation itself. However, during the setup process (where you enter DB creds etc.), there seems to be no CSS or JS files loading - they’re showing as ‘403’ in the Chrome console.

I have tried also to run composer vendor-expose to see if this would help, but this returns a RuntimeException of:

\public\resources\ventor\silverstripe\admin\client\dist does not exist and could not be created

Trying to access this folder directly, it shows a “Location is not available” error:

image

Has anyone else come across this before, and if so, how did you fix it? I’ve tried another fresh install with the same issue so a bit lost at the moment!

Any help appreciated (as always!)

Where is the document root of your webserver configured to point? On a default 4.2 install, it should be pointing to the public directory of the installed files.

Assuming the above is OK, the creation error suggests that there may be a permissions problem. Does your webserver user have sufficient privileges to create directories / files in the file system?

Hi @DorsetDigital

Thanks for your reply. I can confirm it is pointing to the public folder - the pages load fine, it’s just the CSS and JS that appears to be having issues.

No permission issues. The account I use is the only account on the computer (besides the hidden admin account) - I’ve never had any problems with other set ups before. I setup another project back in July using SS 4.1.2, and had no issues with that one.

I’m still seeing the same issue with this - not had much luck in resolving it. I’m assuming that no one else seems to having this issue, so perhaps a config issue? Certainly open to suggestions!

To clarify: I’m running Windows 10 with an Xampp and MariaDB setup, with PHP 7.1.9. I’ve downloaded SilverStripe by following the instructions and command on the “download” page on the SilverStripe website, but I’m seeing an issue with CSS and JS files being inaccessible. There is only one user account on this computer, which is the one I’m using, and has admin access.

Installation Page

DevTools - Console

DevTools - Network

And I’m still seeing the below when trying to access the file through file explorer:

\public\resources\vendor\silverstripe\framewor…\client is unavailable. If the location is on this PC, make sure the device or drive is connected or the disc is inserted, and then try again. If the location is on a network, make sure you’re connected to the network or Internet, and then try again. If the location still can’t be found, it might have been moved or deleted.

The client folder it relates to is showing like this in file explorer:
image

This is a clean install, done (again) just minutes ago. Nothing has been changed, and all files there have been created by the create-project command from the download page on the SilverStripe website.

Any help or pointers would be appreciated, and I will kick myself if it’s something simple!

It sounds like something is going wrong with the symlinking. Maybe force vendor-expose to do a copy instead and see if that fixes the issue? See: GitHub - silverstripe/vendor-plugin: Allows SilverStripe vendor modules to expose directories to the webroot

1 Like

Hi @JonoM

Thanks for the reply!

I’ve tried all of the options there, in hope that at least one (hoping copy) would do the trick, but apparently not!

All of the options seem to throw an error of some sort (in fact, none throws a function not found error)

Have you tried using Vagrant? Might be worth giving that a shot. If it works okay in a virtualised *nix environment then you’ll know there’s something about your Windows environment that is causing an issue.

https://docs.silverstripe.org/en/4/getting_started/installation/other_installation_options/vagrant_virtualbox/

1 Like

Thanks for your help again @JonoM.

I’ve managed to get this working, so I admit, I haven’t tried the virtual *nix setup.

My folder name structure has always been CLIENTREF - domain-name.com. For whatever reason, this was causing an issue. I’ve tried it with a folder called just CLIENTREF, and this has worked fine.

Thanks again for your help - both of you - glad to have got there in the end!

1 Like

Hi there,
Just in case somebody else experiences the same issue described above - I just did.
I finished a project with a fresh installation (4.5.2) via composer and everything went smoothly - theme showed up after composer vendor-expose copy.
Now I just installed a new project (4.5.2) via composer and the above described error message appeared (except now with the **_**resources of course).
My solution: I simply deleted the “\public\resources\ventor\silverstripe” folder and ran the composer vendor-expose copy command again. Then I got the same error message for the theme\simple folder, deleted this one as well and ran the vendor-expose command again and voila, it worked.
Btw I always run the composer vendor-expose copy first when I upgrade and after that went successfully, I switch back to composer vendor-expose auto.

Maybe it has something to do with the order of when to run the vendor-expose in the upgrading process?

1 Like