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.
Related
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 ?
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
I have laravel Vue app and it works perfectly with chrome and firefox. but it doesn't work on Edge or IE11 and the console shows error on arrow function!?
How to compile or transpile to es5 with laravel mix and webpack?
could you show the correct configuration for webpack.mix.js?
tnx alot
UPDATE February 2020
If anyone still need help with this, mix already provide a babel compilation to es5:
A slight variation of mix.scripts() is mix.babel(). Its method
signature is identical to scripts; however, the concatenated file will
receive Babel compilation, which translates any ES2015 code to vanilla
JavaScript that all browsers will understand.
You can use it like this:
mix.babel(['public/js/es6file.js'], 'public/js/app.es5.js')
DOCS
In order to compile your es6 code to es5 follow the following steps:
1) install the babel-env preset
npm install #babel/preset-env --save
And then declare it in your .babelrc in the root directory:
{
"presets": ["#babel/preset-env"]
}
2) compile your code using
npm run dev //for dev environment
or
npm run prod // for production environment
after a lot of search, I've found out that this Vuecomponent causes the error "https://github.com/godbasin/vue-select2" how can I compile it to es5.
the edge console error:
Expected identifier, string or number
and the corresponding line that it shows is this:
setOption(val = []) {
this.select2.empty();
this.select2.select2({
-----> ...this.settings,
data: val
});
this.setValue(this.value);
},
sorry for taking your time
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
I tried deploying the standard angular-play-seed project, which uses angularjs and requirejs webjars to heroku.
However, on heroku it throws an error because it cannot find require.js
Failed to load resource: the server responded with a status of 404 (Not Found)
Trying to fetch requirejs from the URL
/lib/requirejs/require.js
Update:
Thanks for the suggestion James, yes I am able to recreate this locally in activator clean start.
I'm pretty sure some configuration in my sbt-rjs is messed up but I don't know what.
This is what my folder structure looks like
public
/ui
/js
/myApp
/controllers.js
/services.js
/main.js
/paritals
/myApp
/partial1.html
I see this error both during activator start and sbt stage.
[info] Error: Error: /home/sajit/angular-play-seed/target/web/rjs/appdir/./main.js does not exist.
The scala.html page which launches the angular app, myApp has this
<script data-main="#routes.Assets.versioned("ui/js/myApp/main.js")" src="#routes.Assets.versioned("lib/requirejs/require.js")"></script>
What am I doing wrong?
Based on the sbt-rjs docs it looks like you need to set the appDir in your build.sbt, like:
appDir := "ui/js/myApp"