Error "Mac is invalid" sometimes happen in Laravel project use AngularJS - angularjs

I'm using Laravel 5.8 to create an admin system to manage data for my team.
My project is deployed on a VPS use Centos7.
The problem is that, i have deployed many projects on this VPS and they work OK. But with projects used AngularJS or Axios, when i send a request to server, i get error massage "The Mac is invalid!". But these errors do not always happen, just sometime (about 50%).
I have search and follow some instructions like Laravel - DecryptException: 'The MAC is invalid', but all not work.
I have cleared all my cache, rm bootstrap/cache/*, php artisan optimize:clear, check my .env file, setup new project with new ENV_KEY. But none of them work.
Can anyone give my some advises. Thank you!

I had the same problem, but that happend because i was using my HASH in production that was generated in development by the function encrypt()

Related

Migrating from CRA to ViteJS, deployment issue with server URL

Currently moving a work project from Create React App to ViteJS. I was a noob when I started working on this project, so I did what I was thought and started with CRA. Let the attacks begin.
In my CRA project I had an env variable called REACT_APP_SERVER_URL, which is self explanatory, but it just links to localhost:8000 on my local machine and to https://exampleserver.com when deployed. It's used for fetching data on the frontend. To get projects you hit https://exampleserver.com/api/projects
When I moved the project to Vite, I changed the env variable to VITE_SERVER_URL. It's all cool and it works amazing on my local machine.
Let's say client url is https://viteclient.com.
Now comes deployment... App crashes on load. I check the console, and good thong I forgot a console.log in on of the fetch functions to tell me what was the issue. I'm getting a 404 from the server. The app made a request to:
https://viteclient.com/exampleserver.com/api/projects
What happened there?? Is VITE_SERVER_URL a saved name for Vite env variables? if so, I can't find anything online about that. It didn't do that in CRA, it doesn't do that in my local machine. Does anyone have any idea what happened? And/or how to fix it.
I tried looking if anyone has a similar issue, but I can't seem to find any other developers having these issues.

Add-in error Sorry. we can't load the add-in. Please make sure you have network and/or Internet connectivity. Click "Retry" once you're back online

I am developing an Excel JS TypeScript React addin with VS code. I deployed my add-in to Azure and it worked fine. Now I wanted to start a localhost for development purposes but all of a sudden I got this message:
I am posting this question, so clearly there is no issue with my internet connection. Furthermore I tried to surf to the https://localhost:3000 URL and it gave me a blank page with this text:
Cannot GET /
I tried to use the Yeoman Generator to create an empty project because I thought I maybe messed up the webpack.config.js file or the manifest but installing the boilerplate React TypeScript Excel add-in did not get me anywhere neither because even the npm install command did not succeed. I have no idea how to tackle this.
many thanks in advance.
Thanks to Eugenes feedback I dug back into the Yeoman generator and generated a new boilerplate react project and found that a package.json.lock file was blocking npm install. After I removed the package.json.lock file I was able to perform the npm install command and then I compared the manifest file from the newly created boilerplate project to the actual project and I saw that I accidentally replaced the https://localhost:3000 by http://localhost:3000. So if you do not attach the s in HTTPS, it does this strange error. the reason I replaced it is because for production I use another URL.
Most likely something is preventing access to the URL. It can be local firewall software, VPN software, proxy configuration or Metered Connection setting.
Be aware, to run web add-ins you need to generate and install a valid certificate to use https. Office Add-ins should use HTTPS (not HTTP) even when you are developing, because Office clients require add-ins and webpages to come from a trusted and secure location. If your add-in fails to load within an Office client, it may be because you haven't installed (trusted) the certificate that the Yeoman generator for Office Add-ins provides. To make sure a valid certificate is used, try to navigate to the html file in any web browser.
Also you may try to switch to another network connection and try again.

How to Host Laravel-Mix applciation in BigRock?

I am building one application with Laravel as back-end and React.js as front-end. How to host the application in BigRock or GoDaddy? I searched for 2 days, and found nothing related. Please HELP!!
Laravel application hosting don't need something special... just take care of these things.
php version as per the desired laravel version.
composer should be installed on server.
Some pre-dependancies check here... https://laravel.com/docs/5.8/installation
Your domain should point to <application_root>/public folder.
If you are using mix make sure node should be installed.
After that..
Just clone / upload the code on server and run the desired commands like..
composer install & npm install to install the laravel dependancies & node dependancies.
As per your case you are going to host two application here. So you can follow the following approach.
Host laravel application as sub-domain like api.domain.com and react application on main domain.
I hope you are already fimilar with what's required for hosting react application.
Edited:
For the shared hosting, you can request to enabled the shell access from hosting provider support team. Once they enabled, you'll able to run the linux command and do install by yourself.
Sometimes they could install required software for you.
All the best!

How to deploy perfectly Laravel Project with ReactJS to the server

I have project combination of Laravel and ReactJS but i got problem deploying it to our server almost 2 weeks still don't know why i can't access it.
when i try to access the browser.
This site can’t be reached
Step that i do before I deploy the project.
NPM Install
npm run production
zip the files to my computer and paste to the server
No error found when i view the error.log in our server.
Why it happen when i type my link
Example.
www.thisisexamplewebsite.ca
The .ca domain turns to cauwsta
I hope someone could help me and to solved my problem.

cakephp 2.1 migration cache error

I'm trying to migrate my app from cakephp 2.0 to 2.1. I've been using 2.1 for a couple of weeks on my local development server, and everything works fine. I've just tried uploading to the production server, and I'm getting the error message:
Fatal error: Class 'Cache' not found in app/Config/core.php on line 265
I'm probably missing something obvious, but I can't work out what. If anyone has experienced something similar or can offer any suggestions I'd be very grateful!
(I'm using the CakePHP 2.1.0 stable release)
Are you very sure you uploaded all the "core" files (the lib directory)? It seems the Cache class is missing, which is a core class of CakePHP. The error message is indicating an incomplete CakePHP install on your server.
Verify if the file lib/Cake/Cache/Cache.php exists and is readable by the webserver you are using (e.g. ownership is set to apache.apache or www-data.www-data and chmod is set properly. If using SELinux, also make sure the files have httpd_sys_content_t or public_content_rw_t context set).

Resources