I have an Ionic project, which works fine on my windows machine and friend's mac, but I got a problem on linux.
The problem appears on ionic serve, it's infinitely Waiting for connectivity with react-scripts..., and appearing continues while it's running. Development server seems to work fine.
Hope, we'll find a solution.
CLI output:
npm run start
> [project name]#0.0.1 start
> ionic serve
> react-scripts start
[react-scripts] ℹ 「wds」: Project is running at http://192.168.1.66/
[react-scripts] ℹ 「wds」: webpack output is served from
[react-scripts] ℹ 「wds」: Content not from webpack is served from /[project path]/app/public
[react-scripts] ℹ 「wds」: 404s will fallback to /
[react-scripts] Starting the development server...
[react-scripts]
[react-scripts] You can now view better-call in the browser.
[react-scripts] Local: http://localhost:8100
[react-scripts] On Your Network: http://192.168.1.66:8100
[react-scripts] Note that the development build is not optimized.
[react-scripts] To create a production build, use npm run build.
[INFO] Waiting for connectivity with react-scripts...
[INFO] Waiting for connectivity with react-scripts...
[INFO] Waiting for connectivity with react-scripts...
[INFO] Waiting for connectivity with react-scripts...
[INFO] Waiting for connectivity with react-scripts...
[INFO] Waiting for connectivity with react-scripts...
[INFO] Waiting for connectivity with react-scripts...
[INFO] Waiting for connectivity with react-scripts...
[INFO] Waiting for connectivity with react-scripts...
I have same issue, because I used node 18, with 16 it's better.
You can resolve it with this:
Install npm i n.
Install older version of node, 16 works fine for me, then install it with this command -> n 16.
Change version of node that you want, just put n in your terminal, and then select the 16 node version, and use ionic serve again
I hope this works for you.
Best
Related
I am using a Cloud-carbon-footprint-calculator code where the api is in Node.js and client is React.
I have cloned the code in an Azure VM and installed Node.js, npm and Yarn.
Node.js version-v16.17.0
Npm version 8.15.0
Yarn version 3.1.1
I have been able to run the code in Azure VM using "yarn start" and was able to access the app data from server by hitting http://xx.xxx.xx.xx:4000/api/footprint?start=2022-08-19&end=2022-08-19&groupBy=day directly in browser.
I am able to view the client at http:// xx.xxx.xx.xx:3000/, it is hitting the api however after that giving below error.
==============================================================================
The server logs are:
[1] [INFO] 06:26:36 ts-node-dev ver. 2.0.0 (using ts-node ver. 10.8.2, typescript ver. 4.7.4)
[0] (node:6039) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
[0] (Use node --trace-deprecation ... to show where the warning was created)
[0] (node:6039) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
[0] Starting the development server...
[0]
[0] Compiled successfully!
[0]
[0] You can now view #cloud-carbon-footprint/client in the browser.
[0]
[0] Local: http://localhost:3000
[0] On Your Network: http://x.x.x.x:3000
[0]
[0] Note that the development build is not optimized.
[0] To create a production build, use npm run build.
[0]
[0] webpack compiled successfully
[0] Files successfully emitted, waiting for typecheck results...
[0] Issues checking in progress...
[0] No issues found.
[1] 2022-08-24T06:27:46.801Z [server] info: Cloud Carbon Footprint Server listening at http://localhost:4000
[1] 2022-08-24T06:27:53.326Z [api] info: Regions emissions factors API request started
[1] 2022-08-24T06:27:53.335Z [api] info: Footprint API request started.
[1] 2022-08-24T06:27:53.335Z [api] warn: GroupBy parameter not specified. This will be required in the future.
[1] 2022-08-24T06:27:53.340Z [Cache] info: Using local cache file...
==============================================================================
Proxy error: Could not proxy request /api/footprint?start=2021-08-22&end=2022-08-22&limit=90&skip=0 from xx.xxx.xx.xx:3000 to http://127.0.0.1:4000/.
[0] See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNRESET).
I have tried to edit the proxy in package.json in client to add /, use 127.0.0.1/, also the external IP with / but no luck ..
As I am new to React and Node.js, any help is appreciated.
I found one project on GitHub darkwire and wanted to install it and play with it. Firstly I tried to install it from windows. I installed Node.js and Yarn and I got errors with the command: yarn dev
`C:\darkwire.io-master>yarn dev
yarn run v1.21.1
$ concurrently 'cd client && yarn start' 'cd server && yarn dev'
[0] 'c' is not recognized as an internal or external command,
[0] operable program or batch file.
[1] 'client' is not recognized as an internal or external command,
[1] operable program or batch file.
[0] c exited with code 1
[1] client exited with code 1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.`
My next step was to try it in ubuntu 19.10, firstly I installed again Node.js and Yarn and again used: yarn dev. I got an error but now was open site and it not working, just say "Disconnected"
```qq#ubuntu:~/Downloads/darkwire.io-master$ yarn dev
yarn run v1.21.1
$ concurrently 'cd client && yarn start' 'cd server && yarn dev'
$ nodemon src/index.js --exec babel-node
$ react-scripts start
[1] [nodemon] 1.19.0
[1] [nodemon] to restart at any time, enter `rs`
[1] [nodemon] watching: *.*
[1] [nodemon] starting `babel-node src/index.js`
[1] Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`
[1] Checking for inactive rooms...
[1] Darkwire is online at port 3001
[1] events.js:183
[1] throw er; // Unhandled 'error' event
[1] ^
[1]
[1] Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
[1] at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1191:14)
[1] [nodemon] app crashed - waiting for file changes before starting...
[0] Starting the development server...
[0]
[0] Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`
[0] Compiled successfully!
[0]
[0] You can now view darkwire-client in the browser.
[0]
[0] Local: http://localhost:3000/
[0] On Your Network: http://175.124.13.111:3000/
[0]
[0] Note that the development build is not optimized.
[0] To create a production build, use yarn build.
[0]
```
screenshot
I think maybe I have the wrong version Node.js and try install 9.x version, download again project and try again, it not help, try change port from 3001 to 3000, not help.
From their README.md
Darkwire Server
Darkwire server is a Node.js application that requires redis.
So please install a compatible redis server. Redis tutorial
When i write ionic serve nothing opens. I have tried changing nodejs versions. Reinstalling ionic cordova. Also cleared cache and other ways on internet. Nothing works. Please help. No errors are shown but a window is not opened.
Info:
C:\Projects\cutePuppyPics>ionic info
cli packages: (C:\Users\Tullo\AppData\Roaming\npm\node_modules)
#ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0
global packages:
cordova (Cordova CLI) : 7.1.0
local packages:
#ionic/app-scripts : 3.1.4
Cordova Platforms : none
Ionic Framework : ionic-angular 3.9.2
System:
Node : v8.9.1
npm : 5.5.1
OS : Windows 10
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : pro
Serve:
C:\Projects\cutePuppyPics>ionic serve
Starting app-scripts server: --address 0.0.0.0 --port 8100 --livereload-port 35729 --dev-logger-port 53703 --nobrowser -
Ctrl+C to cancel
[20:52:58] watch started ...
[20:52:58] build dev started ...
[20:52:58] clean started ...
[20:52:58] clean finished in 12 ms
[20:52:58] copy started ...
[20:52:58] deeplinks started ...
[20:52:58] deeplinks finished in 40 ms
[20:52:58] transpile started ...
[20:53:03] transpile finished in 5.17 s
[20:53:03] preprocess started ...
[20:53:04] preprocess finished in 4 ms
[20:53:04] webpack started ...
[20:53:04] copy finished in 5.44 s
[20:53:13] webpack finished in 9.14 s
[20:53:13] sass started ...
[20:53:14] sass finished in 1.68 s
[20:53:14] postprocess started ...
[20:53:14] postprocess finished in 16 ms
[20:53:14] lint started ...
[20:53:14] build dev finished in 16.32 s
[20:53:14] watch ready in 16.47 s`enter code here`
[20:53:14] dev server running: http://localhost:8100/
[OK] Development server running!
Local: http://localhost:8100
External: http://192.168.10.8:8100
DevApp: cutePuppyPics#8100 on LAPTOP-NNU75MUT
Sometimes the browser doesn't open automatically. Try entering http://localhost:8100 on your browser manually after ionic serve.
force an ip adresse
ionic serve --address YOUR_IP_ADDRESS
your ip adresse should be available , i think you can use 192.168.10.8 or 127.0.0.1
i'm getting an error when I try to push to BlueMix from local.
> node lib/install.js
> optipng-bin#3.1.4 postinstall /tmp/app/node_modules/img-loader/node_modules/imagemin-optipng/node_modules/optipng-bin
✔ optipng pre-build test passed successfully
> pngquant-bin#3.1.1 postinstall /tmp/app/node_modules/img-loader/node_modules/imagemin-pngquant/node_modules/pngquant-bin
> node lib/install.js
✔ pngquant pre-build test passed successfully
> gifsicle#3.0.4 postinstall /tmp/app/node_modules/img-loader/node_modules/imagemin-gifsicle/node_modules/gifsicle
> node lib/install.js
✔ gifsicle pre-build test passed successfully
/tmp/buildpacks/cbed2b9b0603a1febfaafeebb556dd0b/lib/dependencies.sh: line 1: 163 Killed npm install --unsafe-perm --userconfig $build_dir/.npmrc 2>&1
-----> Build failed
Failed to compile droplet
Check our support community to get help on common issues:
http://ibm.biz/bluemixcommunitysupport
If you need additional help and your subscription includes support, submit a ticket so we can help:
http://ibm.biz/bluemixsupport
Exit status 223
Staging failed: Exited with status 223 (out of memory)
Destroying container
Successfully destroyed container
FAILED
Error restarting application: StagingError
It works great locally. I tried increasing memory to 1GB, didn't help either. Please help.
I am finding the starter repo from angular class very very unstable or just on how I am using it. My code works locally hitting the same service as remote yet I get the below
I followed the rules
npm run build
npm start
The slightest error I get the below:
'Hash: 51619e5be8128fe9ed97eb75ce5c5bacf4f02ce1
Version: webpack 2.1.0-beta.22
Child
Hash: 51619e5be8128fe9ed97
Version: webpack 2.1.0-beta.22
Time: 18736ms
Asset Size Chunks Chunk Names
index.js 3.57 MB 0 [emitted] main
[320] ./src async 160 bytes {0} [built]
+ 544 hidden modules
Child
Hash: eb75ce5c5bacf4f02ce1
Version: webpack 2.1.0-beta.22
Time: 11670ms
Asset Size Chunks Chunk Names
index.js 33.5 kB 0 [emitted] main
+ 28 hidden modules
> universal-starter#2.0.0 start /var/test-starter
> npm run server
> universal-starter#2.0.0 server /var/test-starter
> nodemon dist/server/index.js
[nodemon] 1.11.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: /var/test-starter/dist/**/* src/index.html
[nodemon] starting `node dist/server/index.js`
Listening on: http://localhost:3000
EXCEPTION: Response with status: 200 Ok for URL: null
/var/test-starter/node_modules/zone.js/dist/zone-node.js:140
throw error;
^
Response with status: 200 Ok for URL: null
[nodemon] app crashed - waiting for file changes before starting...
How can this crash a server? I have to kill and restart.
I use angular2 n production without issue. angular2 universal is rather problematic.
How do I resolve gracefully? Or am I not serving in production properly?
The issue seems related with angular/zone.js based on your error.
Try to back to zone.js#0.6.21. If it works, try to locate the codes which cause the issue and reproduce it and post at here.
Since zone.js#0.6.22, there are some new issues, such as https://github.com/angular/zone.js/issues/448