Vue-cli project run using yarn run dev command - javascript

I am running vue cli project using command yarn run dev it compile successfully, but does not show any output on browser on localhost:8080 link, can’t establish a connection to the server at localhost:8080. error displayed.
Not any manual port set programmatically.enter image description here

Related

Vue app compiles successfully but does not load in browser

I have a Vue app that outputs the following in the console after npm run serve.
DONE Compiled successfully in 17450ms 2:15:55 PM
App running at:
- Local: http://localhost:8080/
- Network: http://10.0.0.72:8080/
Note that the development build is not optimized.
To create a production build, run npm run build.
No issues found.
However, the app will not load on http://localhost:8080/ . The page displays the "This site cannot be reached.The connection was reset." message.
Other pages load fine, including the Node server I am using for the backend, running on localhost:3002.
I have tried removing the node_modules and running npm install again, but that hasn't fixed it. With the app compiling ok there is little help troubleshoot. There are also no errors in the browser dev tools console.
Does anyone know what might be going wrong or how to debug this?
Thanks!
change your port with npm run serve --hostname 0.0.0.0 --port 4000 and then run again.

Laravel Mix HMR Server Does Not Launch

Laravel Mix Version: 6.0.43
Node Version (node -v): 16.13.1
NPM Version (npm -v): 8.1.2
OS: Windows 10 21h2
Description:
THIS IS HAPPENING ON A FRESH NEW INSTALL OF LARAVEL AND MY OTHER PROJECTS
Running npm run hot changes the script tag sources to http://localhost:8080/*/*.* from http://localhost/*/*.* HOWEVER I always get net::ERR_EMPTY_RESPONSE from localhost:8080. The HMR server doesn't launch at all. The terminal output of the command also have no mention of spinning up a new web server.
PS C:\Users\Eric Wang\Documents\GitHub\test-laravel-mix> npm run hot
● Mix █████████████████████████ emitting (95%)
emit
● Mix █████████████████████████ done (99%) plugins
WebpackBar:done
✔ Mix
Compiled successfully in 5.51s
Laravel Mix v6.0.43
✔ Compiled Successfully in 5336ms
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬──────────┐├────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼──────────┤│ css/app.css │ 47.6 KiB │└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴──────────┘webpack compiled successfully
Here's a picture of the browser failing to fetch the bundle files
Steps To Reproduce:
I am running Docker 4.5.1 using legacy Hyper-V.
I containerized Laravel and PHP BUT not the frontend and JS. I am running Laravel Mix on my main system.
Clone the fresh installation of Laravel from https://github.com/ericwang401/test-laravel-mix
Clone Laradock in the project folder using git clone https://github.com/laradock/laradock.git
CD to the Laradock folder and make .env file with cp .env.example .env
Inside .env file set PHP_VERSION to PHP_VERSION=8.0 AND DO NOT EDIT MYSQL SETTINGS
Now edit the Laravel environment file
DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=default
DB_USERNAME=default
DB_PASSWORD=secret
Start up the Laravel app in Laradock folder using docker-compose up -d nginx mysql
Enter into bash mode in the Docker container docker-compose exec workspace bash
Install Composer dependencies BUT NOT NPM DEPENDENCIES YET composer i
Now exit out of the Docker container CNTRL + D
Install NPM dependencies in project root ON YOUR MAIN SYSTEM npm i
Run on your main system npm run hot
Now go to http://localhost and IT SHOULD be a white screen
Check console logs and it should give net::ERR_EMPTY_RESPONSE when it tries to fetch the bundle files
REMEMBER: the backend is running inside Docker
The frontend (Laravel Mix) is running on the host system
This issue is happening on a FRESH project installation of Laravel 9 + Jetstream AND it's also happening on my other older projects like https://github.com/StratumPanel/Stratum-Panel
The HMR server is simply not launching.
I found out the issue. The problem was that the default port, 8080, Laravel Mix HMR was using couldn't be binded to. Webpack Dev Server doesn't respond with a message of failing to bind to a port. To confirm this issue, I replicated the environment on my friend's PC and it too couldn't bind to port 8080, but this time it reported an error that the dev server couldn't bind to port 8080.
I fixed this issue by specifying
mix.options({
hmrOptions: {
host: 'localhost',
port: 4206
}
});
And it works! On both my friend's pc and my pc.
I used the exact same reproduction instructions on my friend's PC.
I spent way too long investigating this issue 😭

The serve command requires to be run in an Angular project, but a project definition could not be found?

I got this error when running ng serve command
C:\Mysystem\Programs\myfwms>ng serve The serve command requires to be
run in an Angular project, but a project definition could not be
found.
when i try this existing project getting this error
The above statement requires the angular project to be run in the same port where it is created. When the server has killed the system redirect the port to Localhost:4200 and localhost:8080. Therefore it faces difficulties in recoating the port:3000. Following command line can help to redirect the particular port from where it is created:
npm run serve 1

build failed react-native 0.6.5 We ran "xcodebuild" command but it exited with error code 65

I'm having this problem "error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening starter.xcodeproj. Run CLI with --verbose flag for more details." since I pulled the latest update from the other colleague, I can't run the project in my simulator, but my colleagues side works fine.
I've tried to change the build system to legacy build system.
Clone the project again.
remove the build folder under iOS folder, and run again.
remove the node module folder and run again.
I have tested in different device is not working too.
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening starter.xcodeproj. Run CLI with --verbose flag for more details.
User defaults from command line:
IDEDerivedDataPathOverride = /Users/nexplatform/Desktop/padini scm mobile/SCM/ios/build/starter
brew install cocoapods
cd projectfolder/ios
pod install
and
cd..
react-native run-ios

npm start stopped working on react project

I've been working on a project using React.js
It used to work fine on localhost:3000 but suddenly this has stopped working.
The commands I did before was
sudo npm run bundle
sudo npm start
And then my project was running. But now it says localhost refused connection. Message in the console:
"Failed to load resource: net::ERR_CONNECTION_REFUSED". Any ideas why?
I have checked that localhost:3000 not occupied
I have checked that Im working in the correct folder and all files seems * to be present
I have checked that Im using the latest npm and node version
You don't say what OS you are using but if it is MacOS or Linux you might want to check what $HOST is set to.
See How to start a react app with a custom host and port

Categories