I am working in an web application and I got access to the files of the project. I am trying to run in local.
I've downloaded all the source code and the vendor libraries. Then I tried to run the project by the console.
It seems to work fine, but when I try to open the page in my browser it is just white.
I don't even know how to start looking for an error. How can we look for bugs or errors in this case?
Related
I've been developing a website built on OctoberCMS, using the Laravel Homestead vagrant box as my local development server and have so far been getting along swimmingly. I developed most of a theme this way.
However I've recently started running into a problem wherein requests for assets/vendor.css in the theme assets succeed but receive a text/html response containing HTML for the homepage instead of the proper CSS.
This means vendor CSS for the page doesn't load. However if you repeat the request for vendor.css with "open in new tab" after page load the correct asset is returned, and the Chrome 'sources' tab also shows the correct asset.
This strange behaviour seems to extend to JS assets. I'm currently looking at a request for assets/vendor/jquery.js where the inital response actually contains the contents of assets/theme.css - and this is causing JS errors in the console.
In this case however if I make the request to that URL again I actually still receive the same incorrect CSS, but once again the Chrome 'sources' tab actually shows the correct asset.
Inspecting the files in my code editor I see the correct assets under the correct filenames and locations.
It seems I might have an issue with Homestead's web server. However I'm confused about where it might have come from as I haven't reconfigured anything and this has been working fine previously.
I've confirmed that the problem still persists even after deleting the homestead VM, and then building a brand new one and installing a fresh copy of OctoberCMS, without importing any of my own custom theme files.
I tried having a look into the nginx logs on the VM to see if I could spot anything odd, but it looks like they all have no content, 0 lines.
I'm a bit stumped and haven't found much helpful searching around.
Any suggestions? Help much appreciated.
So I've managed to re-build my project in such a way that this time I didn't reproduce the problem.
I'm pretty sure that ultimately it was caused by the fact that I relocated the homestead VM (and projects therein) by renaming its containing folder.
In previous attempts I had been deleting the VM by running vagrant destroy and then re-creating it by running vagrant up.
Once I completely deleted the homestead repository and re-cloned it from scratch from laravel/homstead on github, then proceeeded to vagrant up and set up OctoberCMS, I no longer experienced the issue.
I suspect perhaps the original path to my VM (before rename) was still in a configuration file somewhere in the laravel/homestead project and the disconnect between this value and the actual filepath was causing the problem.
I am building a module for SilverStripe. I am simply extending LeftAndMain.php and showing a template by placing the template file at templates/module/namespace/MyClass_Content.ss
It is working like a charm locally and I can see all the changes I am making to MyClass_Content.ss in my browser. But when I host it on my server, everything else works fine, I can see my navigation item too, but on right side, where content is supposed to be rendered, empty space.
Just to poke around, I navigated into the vendor folder locally and on the server, and I edited the MyClass_Content.ss file by placing a HELLOWORLD on the starting of the file. Locally, I can see the HELLOWORLD disrupting the whole view and the breadcrumbs, but on the server, no change, empty right side.
There are no error logs for nginx or php. The error logs in the console don't seem to be important since I see the same on both local and server. Even the JS and CSS is loading on the server, the only difference in the network panel is the images won't load on the server, which makes sense since the template won't load.
How do I debug this? Any ideas?
Update: Actually, it was the namespace. Namespace was Silverstripe but the template path was SilverStripe. Locally worked due to case-insensitive environment, but failed on prod due to a case-sensitive environment.
I just checked your repo - move your templates directory up to sit next to src instead of inside it. :)
I have a strange error in my Laravel(5.6)/app. Whenever there is any route request in the app, all css, js, bootstrap and icons files reload all over again in the browser. I'm debugging this app from last 2 days. And I have no clue what's going on.
I worked on this project a few days ago and it was working fine then I started working on some other project and after a couple of days when I worked again on this project to add some new features, it is behaving like this. Whenever I request any route in the app, all the assets download and load again in the browser. I didn't provide any code sample here because I don't know where the error might be.
If there have been an error in some particular file then that particular route would have behave that way. But all routes reload all the assets all over again. So I just want your opinion is this ever happens to you and how should I tackle it?
If you wanna recreate this project then here is the GitHub link. Git Repo . Recreating this project is very easy. Just create a database. run migrations and then seed the database. For sass and js ,run 'npm run dev' if needed.
Update: Solution to this problem is, don't use buit-in server of laravel, it sucks. Use any php development stack like xampp, wamp etc. and it will work fine.
Since recently I use PhpStorm 2016.3.1 for my php projects. XAMPP works in the background and is connected to the IDE. It's a great IDE but I'm searching for a solution to run a single file in the browser.
The index file of Laravel loads over the run command perfectly. But an individual file makes a problem.
Everytime I want to open the file the browser gets me an error back that the directory to the file is wrong or the classes not found.
How can I setup that for a better workflow?
My Symfony debug toolbar (v1.3.7) is appearing correctly but clicking it generates a javascript error.
Looking through the source code, I can see that the javascript for the toolbar is not being sent back to the browser. I have another project set up on the same machine which uses Symfony v1.4 and this works fine.
This project is also set up on one of my colleages' machines and it is working fine. The project itself is also running without problems.
Any ideas what might be causing this issue?
You probably didn't correctly link the assets in your web root.
You need to copy/symlink/... /path/to/symfony/data/web/sf to /path/to/project/web/sf