Laravel Vue.js components are not working on server - laravel

I am new to Laravel Vue and I recently came to a project. at my localhost everything working fine, but when I pushed my project to the server via git, the Vue components not working. it says this error in the console...
Uncaught SyntaxError: Unexpected token '<' app.js:1
there is no npm install on the server so I run the command locally "npm run production" and pushed the app.js and all other js files via git to the server.. the server files are the same as localhost but Vue components not working on the server, but they are running on localhost..., I am stuck to the problem with 3 days, any help will be highly appreciated.
Thanks
Just for clarity, the CSS file is rendering but the JS file not
In my console:
Resource interpreted as Stylesheet but transferred with MIME type text/html: /rider/auth/public/css/app.css.
Uncaught SyntaxError: Unexpected token '<' app.js:1

So the issue was in the .env file , and there was a variable "ASSET_URL = ./public" , this was not allowing the application to go to the correct path . Thanks #Aless55 for your great support

Related

Nuxt 3 after building : [Vue Router warn]: No match found for location with path "/anynonexistingroute"

I built a nuxt 3 project using npm run build and i`m running it with "node .output/server/index.mjs", just to test it. But when I make a request to a inexistent route, this warning is outputed to the terminal, and I think that on production it would slow down the performance. How can I fix this, or at least disable terminal logs ?

Error during building swagger in laravel application with vite

Get the following error after running npm run build in laravel. If I run npm run dev everything seems to work fine. But in build this error occurs.
rendering chunks (2)...warnings when minifying css:
▲ [WARNING] Expected identifier but found "*" [css-syntax-error]
<stdin>:1:30219:
1 │ ...fter{clear:both}.swagger-ui .cf{*zoom:1}.swagger-ui .cl{clear:le...
╵
Following error is shown during loading the swagger page:
Uncaught TypeError: Cannot read properties of undefined (reading 'isRequired') swagger.67892d56.js:162
at 1543 (swagger.67892d56.js:162:9585)
at Ve (swagger.67892d56.js:191:4143)
at swagger.67892d56.js:193:40222
at swagger.67892d56.js:193:72778
I am building a laravel application and using swagger for route documentation. In production it works well but during build this error occurs.
Looks like this issue which was fixed in Swagger UI v. 4.15.3. Update your app to use the latest version of Swagger UI.

I've got an issue with using 'visit'

When my Cypress tests are run on Github (headless).
When I call visit('/page') - get a 404 error. The page definitely exists.
CypressError: 'cy.visit()' failed trying to load:
http://localhost:4200/page
I can run the same tests locally (headless and headed) and they work fine.
Anyone have any ideas why this could be?
I should add that this is an Angular Application and there are no 404's because all routes are handled with wildcard. I know this page exists and happens if i try to visit another page that exists.
Version:
"cypress": "^10.6.0",
This is the .yml file. The baseUrl is set to 'http://localhost:4200' in the 'integration.config.ts' file.
So found the answer.
We are serving the Angular application with 'http-server'. It was only recognising the route '/' and was returning a 404 for any other app routes / pages.
We fixed this by adding --proxy http://localhost:4200? to the http-server command.

Vuejs3 + laravel 8 working find locally but in prod vuejs files throwing syntax error and view not render Uncaught SyntaxError: 59

build a project using Vuejs 3 in Laravel 8 went running on Laravel server it works well but went I run npm run prod and deploy it in Cpanel compilation fails with Uncaught SyntaxError: 59 in the console I have remove style and script tags from blade file but still have a problem. please I really need your help
Please check your final html code. May be there you will find a <style>...</style> or <script>...</script> tags... These are the main problem of Uncaught SyntaxError: 59. Yes, it will be ignored in local and development environment but won't in production one...
For example:
<div id="app">
<script>
alert('yes');
</script>
</div>
The main idea to put script and style tags out of the div#app element.

Import aws-amplify in Ionic2

OverView
I develop an ionic mobile app with Visual Studio.
When I added import statement in src/app/main.ts, my app got not working and didn't render expected page.
Please tell me how to solve this.
I published my app to github.
link to my github page
Process of my app not working
I installed aws-amplify by npm command.
$ npm install aws-amplify --save
I selected "Ionic 2 - Tabs" template and created new a project.
Visual Stido "Ionic 2 - Tabs"
I added import statement in src/app/main.ts.
import Amplify, { Auth } from 'aws-amplify';
My app got not working.
Error messages and ScreenShots
JavaScript Console shows messages below.
Failed to load resource: net::ERR_FILE_NOT_FOUND
main.css
Failed to load resource: net::ERR_FILE_NOT_FOUND
main.js
Failed to load resource: net::ERR_FILE_NOT_FOUND
polyfills.js
My app is expected to render the page below.
expected page
But it rendered the page below.
unexpected page
From the error it doesn't look like from aws-amplify. How about first try remove import from aws-amplify?
It more like the visual studio template has problem. I just tried command line it works fine.
ionic start myApp tabs
cd myApp
ionic serve
Here is an aws starter template maybe you could try follow.
https://github.com/ionic-team/starters/tree/master/ionic-angular/official/aws

Resources