independent full stack developer

/ Developer's blog

How to fix [prerender-spa-plugin] Unable to prerender all routes

Tuesday, May 30, 2023

How I fixed the prerender error with  [prerender-spa-plugin], it worked yesterday but today not, just try to add a param to your webpack maxConcurrent ...

Hey, if you work with vue-cli and prerender your apps with prerender-spa-plugin, and it worked yesterday, but it doesn't work today - and you got the message Unable to prerender all routes

read more Like the other 3652 people already did

How to fix Laravel 5.8 artisan command Failed to clear cache. Make sure you have the appropriate permissions

Tuesday, May 30, 2023

I just deployed a new system on production, opened a browser and see the error about permissions for my Laravel logs and do on, I checked the default paths, vhosts, config...but nothing happens. Then I think that clearing Laravel config cache with the command is a good idea.

php artisan config:clear

But I got the error

Failed to clear cache. Make sure you have the appropriate permissions.

read more Like the other 5560 people already did

Problem rendering component row in table with Vuejs

Tuesday, May 30, 2023

You created a vuejs component that contains a table row, inserted it to tbody and noticed that it appear about the table? Yeah,  me too, there is my solution.

If you experience something like that, means that you did something wrong :) Please check the docs firstly (Vuejs Docs) about that, and if you can't find the solution, back to me and check my solution.

read more Like the other 1761 people already did

If class not found, or file not exists on Laravel

Tuesday, May 30, 2023
read more Like the other 1422 people already did

How to add SSL certificate to nginx for FREE

Tuesday, May 30, 2023

Firstly we have to issue certificates, I use this service to get it done. https://www.sslforfree.com you just enter a domain name for which you need a certificate and then download the archive with certificates. The next step is compiling contents to one bundle.crt and tweak a host for nginx.

read more Like the other 1548 people already did

How to fix CORS issues with Chrome localhost Laravel REST API

Tuesday, May 30, 2023

Hey, there are a couple issues if you're working on SPA or simple project where you need to get data from the backend in your JS code, but there is an issue when you try to test it. You can experience the issue with CORS 

Origin http://localhost is not allowed by Access-Control-Allow-Origin

If you work with Laravel as a backend and have a REST API - you're welcome, I will show you the simple way how to fix it for localhost test case.

read more Like the other 2639 people already did

How to fix Nodemon Command not found on Ubuntu 16

Tuesday, May 30, 2023

Hey, I suppose that you already googled and try some answers on SO about that. I have a good solution how to fix the error with nodemon, when you do npm install -g and then nodemon server.js and see: Command not found.

I solved it with the next:

sudo npm install nodemon -g
sudo ln -s /usr/local/lib/node_modules/nodemon/bin/nodemon.js /usr/local/bin/nodemon

That's it, with this command we install nodemon, and then create a symbolic link. It works like a charm.

read more Like the other 14346 people already did

What if "Cannot find module cross-env" for npm run dev with Laravel 5.5 and Vuejs

Tuesday, May 30, 2023

Hey, I feel anyone can experience such bug with fresh install Ubuntu 16.04 and Laravel 5.5 for your local environment.

So, if you're stumbled with such errors like when you try to use npm run dev

Cannot find module cross-env
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode 
Make sure you have the latest version of node.js and npm installed

Very often it means that you have an old version of your nodejs, so when you install it as apt-get install nodejs, you will install and old LTS version 4.2.6 that too old. To fix it, you just need to update your Nodejs and everything will work seamlessly. How to do it? Follow the next steps.

read more Like the other 2515 people already did