Failed to parse source for import analysis because the content contains invalid JS syntax with laravel 9.3.3.0 - laravel

Hello everyone,I'm learning about Laravel but I have this issue when I try load both register and login but it's a simple warning,what can I do to fix that?

Related

Find exact value of VUE_APP_API_BASE_URL for laravel project

I have a laravel + Vue.js project template downloaded from Creative Tim. Its login and register is not proceeding, giving the catch error whereas in the template demo its working fine. I think so the instructions said to write the VUE_APP_API_BASE_URL in Vue .env file and I didn't wrote it correct. Can anyone pls tell me how can I locate the exact address and what syntax it would be?
Since you are using vue with laravel, you need to prefix MIX_ before the variable. Eg:
MIX_VUE_APP_API_BASE_URL=http://localhost:8000
Here is the reference: https://laravel.com/docs/8.x/mix#environment-variables

Uncaught SyntaxError: Unexpected token '<' in app.js in Gcloud

I'm very new to Gcloud after 4 attempts I deployed local Laravel + Vue Project to Gcloud. It worked fine in local env, but the app showing blank page after deployment and the console showing below error message.
Uncaught SyntaxError: Unexpected token '<' app.js.
Even the resource files also not visible.
App link: https://fluted-vehicle-277421.el.r.appspot.com/
Can anyone suggest what went wrong?
This error typically gets thrown when in js file you have put html.
Try checking if you have html inside js file and remove it.
Regarding the error you mentioned in your post, as you can see here, this error is most likely the result of a 404 page or a redirect to a page that serves regular html instead of the JavaScript files.
On the other hand, I am not sure if you deployed a new version but currently, the error I see if I go to your site is "There is no existing directory at "C:\xampp\htdocs\LMS_project\storage\logs" and its not buildable: Permission denie". So, as I can see these errors are because you are not change correctly the paths in your app. You need to ensure the right paths in order to avoid this errors.

Laravel CRUD using Firebase

I'm trying to implement Realtime CRUD using Google Firebase in my web application,I've managed to retrieve data from the Firebase Database but I saw an error while inspecting elements.
Error:
Uncaught ReferenceError: $ is not defined at users:37
I've tried all possible solutions, these made the error gone but I can't add/update/delete data. basically none of this work
links:
ReferenceError: $ is not defined
Laravel 5 WebPack JQuery - $ is not defined
https://medium.com/#onwuka_gideon/fixing-laravel-jquery-is-not-defined-a316fd918e0a
I've followed every step on here:
*note that I am using Laravel 5.8 rather than 5.6
https://laravelcode.com/post/laravel-56-realtime-crud-system-using-google-firebase#
You can recreate the problem by following it.
include jQuery before firebase.js i.e.
recreated and worked as you mentioned in this LINK
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="https://www.gstatic.com/firebasejs/4.9.1/firebase.js"></script>
Example Repo - GITHUB

Including a php file from another server in Laravel controller

Hello i am try to include a PHP class (Payroll.php) found on another server since it requires the main module that has been written in pure PHP in my Laravel sub-module. I was given the url to the php file on the other server and have been tasked with using it to fetch the employees from the main module to be used in my module. Almost all the solutions i found on the internet where for cases where the laravel code and the php code exist on the same server. I tried several approaches such as including the file directly (which is giving me class not found) and using things like guzzle and so on (which failed since it is not an API). Any help would be appreciated.

Failed to load resource when using Auth

The problem
If I use the class Auth in a route/view/controller what so ever, I get the following error in chrome/firefox etc: Failed to load resource URL_TO_CURRENT_PAGE:LAST_LINE_NUMBER
The Html is correct, if I copy the code and paste it into a .html file and open it via the webserver I get no errors.
My code
http://paste.laravel.com/zpp
is this a bug or is it my fault?
I found the problem, the problem is the library entrust. If I dont use it, everything works as intended.

Resources