LiveReload with Guard not working, even though it says it does - guard

I'm trying to use Guard with LiveReload plugin for Chrome on Windows 7. It's not working and I don't know how I can trouble shoot this really. I'm using Bash to initiate guard, then activating LiveReload in the browser.
This is what it tells me:
$ guard
17:42:43 - INFO - Guard is using TerminalTitle to send notifications.
17:42:43 - INFO - Guard is now watching at 'c:/wamp/www/test'
17:42:43 - INFO - LiveReload is waiting for a browser to connect.
Please add the following to your Gemfile to avoid polling for changes:
require 'rbconfig'
gem 'wdm', '>= 0.1.0' if RbConfig::CONFIG['target_os'] =~ /mswin|mingw|cygwi
n/i
[Listen warning]:
[1] guard(main)> 17:43:14 - INFO - Browser connected.
17:43:14 - INFO - Browser connected.
17:43:22 - INFO - Sass [0.01s] styles.scss -> styles.css
←]2;[Guard::Sass] styles.scss -> styles.css
17:43:23 - INFO - Reloading browser: css/styles.css
17:43:33 - INFO - Sass [0.00s] styles.scss -> styles.css
←]2;[Guard::Sass] styles.scss -> styles.css
17:43:34 - INFO - Reloading browser: css/styles.css
09:00:34 - INFO - Sass [0.01s] styles.scss -> styles.css
←]2;[Guard::Sass] styles.scss -> styles.css
09:00:35 - INFO - Reloading browser: css/styles.css
[1] guard(main)>
So, it says it is reloading the browser. But nothing is happening. Any ideas about what could be wrong here?

Hi I think that the thing which you need is to install a livereload extention for you browser.
this one is for google chrome
https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei
thant after runing the command guard
click on the livereload icon :
Good luck

d_rails's comment helped me: use
guard --debug
In my case, I saw:
21:34:51 - ERROR - Guard::LiveReload failed to achieve its <start>, exception was:
> [#cddd037a00ab] RuntimeError: no acceptor (port is in use or requires root privileges)
Oddly, the output is ERROR, not debug. I have no clue why that's not important enough to show if --debug is not specified.
To find out what was using that port, I ran (for Ubuntu 14.04) lsof -i :35729 (the default port of livereload) and found out that my Sublime Text livereload plugin was already using that port. I decided to change the port used by my ruby app with livereload. In my guardfile, I used:
guard :livereload, port: 12345 do
...
end

Related

Connection to flow server got closed. See the output for more information

I got this error message when using React Native on vscode. Is there a way to fix it?
[Error - 2:57:25 PM - MyRealmApp\.flowconfig] Error loading flow using option 'useNPMPackagedFlow'
Pkg flow-bin not found in c:\Users\ReactNativeProjects\MyRealmApp
[Error - 2:57:25 PM - MyRealmApp\.flowconfig] Error loading flow using option 'pathToFlow'
'flow' not found
[Info - 2:57:25 PM - MyRealmApp\.flowconfig] Falling back to bundled flow.
[Info - 2:57:27 PM - MyRealmApp\.flowconfig] Using flow 'c:\Users\.vscode\extensions\flowtype.flow-for-vscode-1.9.2\node_modules\flow-bin\flow-win64-v0.107.0\flow.exe' (v0.107.0)
.flowconfig:28 Unsupported option specified! (format.bracket_spacing)
[Error - 2:57:28 PM] Connection to server got closed. Server will not be restarted.
Basically this issue was caused by not having installed the same version of flow-bin as declared in the .flowconfig of the projects.
Now what you have to do to fix that, is to maintain coherence in the current .flowconfig of the project in your VS Code.
How to do that?
You can just do the below thing and it will fix your issue. If you don't have a yarn, then use npm in place of yarn.
yarn global add flow-bin#version
npm run ios or npm run android
The above will help you fix the issue, but you will always have to check whether they are getting pointed to the same version. In order to fix it stably, you can do the following:
In your VS Code settings you need to point flow.pathToFlow to your workspace node_module:
// settings.json
{
"flow.pathToFlow": "${workspaceFolder}/node_modules/.bin/flow",
}
${workspaceFolder} is a special variable provided by VS Code and it always points to the current project folder. You can find it in the variables reference page of the official docs.
You can prefer to use the local Flow module because this way you can ensure that the installed version and the configured one in .flowconfig always match even when you switch projects.
There is an extra setting for that: flow.useNPMPackagedFlow, just set it to true and you are done (no need to change flow.pathToFlow)

How to auto-attach vscode-debugger to vue-cli process

I am trying to use the auto-attach feature of VSCode(version 1.50.1) to debug my vue app (vue-cli version": "4.3.1").
Like it is explained here:
https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_auto-attach-feature
My OS is Widows 10
In VSCode Auto Attach is set to to only with Flag.
I start my app with npm run dev.
This is how the dev command looks like in my package.json:
node --inspect --max_old_space_size=2048 node_modules/#vue/cli-service/bin/vue-cli-service.js serve
When i run npm run dev, the terminal prints: Debugger listening on ws://127.0.0.1:9229/2fa6ba43-dfa9-41cf-be5d-f0fc8945f02a
and:
Debugger attached
The Blue Bar on the bottom of VSCode turns orange and it seems like i am debugging.
But when i open the app in my browser (Chrome 86.0.4240.75) my Breakpoints are completely ignored.
I suspect that maybe the problem occurs because i do not access my app on "localhost:8080".
I use xip.io which results in an url like this: http://example.127.0.0.1.xip.io:8081/.
Has anyone an idea how to get it runnning?

npm run start:dev in NestJs not to rebuild when i make some change in my code

When I run npm run start:dev in NestJs it works like this:
10:00:00 AM - Starting compilation in watch mode...
10:00:10 AM - Found 0 errors. Watching for file changes.
Debugger listening on ws://127.0.0.1:9229/0cb76900-3b46-4f68-82c0-ea78ed36f327
For help, see: https://nodejs.org/en/docs/inspector
[Nest] 3932 - 03/06/2020, 10:00:23 AM [NestFactory] Starting Nest application...
[Nest] 3932 - 03/06/2020, 10:00:23 AM [InstanceLoader] JwtModule dependencies initialized +41ms
[Nest] 3932 - 03/06/2020, 10:00:23 AM [InstanceLoader] ConfigHostModule dependencies initialized +2ms
[Nest] 3932 - 03/06/2020, 10:00:23 AM [InstanceLoader] ConfigModule dependencies initialized +2ms
enter image description here
But when I changed the code it was not rebuilt. It just shows like this:
10:40:27 AM - File change detected. Starting incremental compilation...
10:40:27 AM - Found 0 errors. Watching for file changes.
enter image description here
Can anyone help me to fix it? Thanks very much.
It has something to do with Circular Dependency as stated here: https://docs.nestjs.com/fundamentals/circular-dependency. Simply means some module which are depended on each other are called recursively which as I learnt from https://stackoverflow.com/users/8966778/ruslan-gonzalez in the NestJs community, makes the app fail from starting up which he also helped me fix.
If you can create a minimal repo and share the link, so I can check it for you
The reason why the logging is not being shown is because you may have the logger disable in your configuration since the tsc shows that compiling is fine but nothing else, checkout the main.ts file and enable the logger.
const app = await NestFactory.create(AppModule, {
logger: false,
});
to
const app = await NestFactory.create(AppModule);
Hope that helps!
In my case it worked for me by deleting the dist folder and recompiling the project

React-Native - Could not connect to development server (iOS simulator)

Error:
Could not connect to develpment server.
Ensure the following:
- Node server is running and available on the same network - run 'npm start' from react-native root
- Node server URL is correctly set in AppDelegate
URL: http://127.0.0.1:8081/index.ios.bundle?platform=ios&dev=true
I definitely am running npm start. Why isn't this running?
Now I am seeing this Error:
In file included from /Users/*******/f8app/node_modules/react-native-fbsdk/ios/RCTFBSDK/core/RCTFBSDKAccessToken.m:19:
/Users/*********/f8app/node_modules/react-native-fbsdk/ios/RCTFBSDK/core/RCTFBSDKAccessToken.h:21:9: fatal error:
'FBSDKCoreKit/FBSDKCoreKit.h' file not found
#import <FBSDKCoreKit/FBSDKCoreKit.h>
Does the project build succeed in Xcode?
Did you double-check these steps mentioned by facebook:
Make sure that the Facebook SDK frameworks are installed in
~/Documents/FacebookSDK.
Make sure that FBSDK[Core, Login, Share]Kit.framework show up in the
Link Binary with Libraries section of your build target's Build
Phases.
Make sure that ~/Documents/FacebookSDK is in the Framework Search
Path of your build target's Build Settings.
(https://github.com/facebook/react-native-fbsdk)
I myself had some troubles with the final step, but after retrying in a fresh project all worked fine
Example image from web showing the correct search path
If the project build doesn't succeed, you may want to try this.
You should first update your existing FBSDK (if any)
https://medium.com/#alberto.schiabel/react-native-on-xcode-beta-8-0-how-to-fix-initial-build-error-f0225c649850#.439zl5504

Composer keep requiring mbstring

i've installed composer and now trying to run composer require maknz/slack. However i keep getting an error, that i can't seem to fix. i've tried to install mbstring, but it still give me this error? what am i doing wrong?
- Installation request for maknz/slack ^1.7 -> satisfiable by maknz/slack[1.7.0].
- maknz/slack 1.7.0 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
To enable extensions, verify that they are enabled in those .ini files:
- /etc/php/7.0/cli/php.ini
- /etc/php/7.0/cli/conf.d/10-opcache.ini
- /etc/php/7.0/cli/conf.d/10-pdo.ini
- /etc/php/7.0/cli/conf.d/20-calendar.ini
- /etc/php/7.0/cli/conf.d/20-ctype.ini
- /etc/php/7.0/cli/conf.d/20-exif.ini
- /etc/php/7.0/cli/conf.d/20-fileinfo.ini
- /etc/php/7.0/cli/conf.d/20-ftp.ini
- /etc/php/7.0/cli/conf.d/20-gettext.ini
- /etc/php/7.0/cli/conf.d/20-iconv.ini
- /etc/php/7.0/cli/conf.d/20-json.ini
- /etc/php/7.0/cli/conf.d/20-phar.ini
- /etc/php/7.0/cli/conf.d/20-posix.ini
- /etc/php/7.0/cli/conf.d/20-readline.ini
- /etc/php/7.0/cli/conf.d/20-shmop.ini
- /etc/php/7.0/cli/conf.d/20-sockets.ini
- /etc/php/7.0/cli/conf.d/20-sysvmsg.ini
- /etc/php/7.0/cli/conf.d/20-sysvsem.ini
- /etc/php/7.0/cli/conf.d/20-sysvshm.ini
- /etc/php/7.0/cli/conf.d/20-tokenizer.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Installation failed, reverting ./composer.json to its original content.