I have a custom error handler that's supposed to show a notification with gulp-notify and then log it in the console.
module.exports = function () {
return plumber(function (err) {
notify({
title: 'Gulp Build Error',
message: 'Check the Task Runner or console for more details.'
}).write(err);
gutil.log(err);
this.emit('end');
});
};
I'm inclined to believe it's set up properly, because it's successfully printing this in the console (followed by the error details):
[15:35:04] gulp-notify: [Gulp Build Error] Check the Task Runner or console for more details.
However, no toast notification is being displayed. Oddly enough, this exact configuration was displaying it a few weeks ago. Does anyone see any red flags in the way this is configured or know of anything that may be preventing the toast notification from popping up? I'm on Windows 8.1, and SnoreToast is set to show notifications in Notifications Settings.
Thanks.
Update: This appears to be a Windows 8.1 issue. I ran this on a Windows 10 machine and the notification showed up.
Related
I am trying to make the connection between chrome (v - 67) and chrome (v- 79), at the time got the error like:
WebSocket connection to 'wss://global.vss.twilio.com/signaling' failed: Error in connection establishment: net:: ERR_SOCKS_CONNECTION_FAILED
I have attached the video link here. please check out and let me help out for this.
Chrome (v-79) : connection is successfully.
check below url- https://drive.google.com/file/d/1aVsRhDEmp7q1atAwMcbh9L_bPv-iiqNA/view
Chrome(v-67): Could not connect to Twilio: Signaling connection error
check URL: https://drive.google.com/file/d/1TbGaJ_aSyfswTGOXA-8Sw1u_s_skBH-C/view
I have added below option in connectOptions
const connectOptions = {
_useTwilioConnection: true
};
But I have faced the same issue. I have created an Http tunnel. So, If you want to check this feature using my end.
please hit this link: https://b256e195.ngrok.io
Code to reproduce the issue:
Video.connect(data.token, connectOptions).then(roomJoined, function (error) {
alert("Video connect error part");
console.log(error);
log('Could not connect to Twilio: ' + error.message);
});
Expected behavior:
I need to work on both sides.
Actual behavior:
The connection could not establish in chrome (v-67)
Software versions:
[x] Browser(s): Chrome(v-79), Chrome(v-67) (not working), Chrome(v-75) (not working)
[x] Operating System: window 10
[x] twilio-video.js: we have migrate from 1.x to 2.x
[x] Third-party libraries (e.g., Angular, React, etc.): Angular js
After two weeks of trying to run my site, I'm asking for your help.
Has anyone hosted Sails.JS on PlanetHoster?
My queries don't work because the connection to the database doesn't seem established.
Here's an example of some very simple queries:
await User.findOne({ email: email });
Here's what's displayed in the browser error console:
Uncaught (in promise) Error: Request failed with status code 500
I've tried to handle the errors but nothing is displayed...
try { await User.findOne({ email: email }); } catch(err) { // nothing }
So I've deduced that it was a problem with calling the database.
Unfortunately, I have no way to read the error logs ...
Yet, I've set the production.js file (config/env/production.js) and when I run NODE_ENV = production node app.js, it's still displayed in development. In fact, PlanetHoster doesn't require running the command sails lift, it just runs the platform already ...
I'm currently in a total blur as for where to go from here so if you have suggestions, I will take them with pleasure.
Thank you
Environment: Sails v1.0.2
I am using the gulp-aemsync plugin to sync my css and js changes to a clientlib on an AEM instance. A have a gulp task watching the js and css that runs gulp-aemsync fine (changes are on the site when i refresh), but being a bit lazy as i am it would be nice to get live reload working so that i never have to manually refresh the page while working.
I have tried to follow both these 2 online guides:
https://adobe-consulting-services.github.io/acs-aem-tools/features/live-reload/index.html
https://www.cognifide.com/our-blogs/cq/up-and-running-with-livereload-in-adobe-aem6
Followed the steps of:
installing Netty package on AEM instance
installing ACS AEM tools package on the AEM instance
installing the RemoteLiveReload chrome extension (the AEM instance is hosted on AWS)
That didn't work, so i got one of our DevOps engineers to open port 35729 (which is the default for Livereload) on the AEM instance. That still doesn't work, and when i click the chrome browser extension to sync it i get the following message:
Could not connect to LiveReload server. Please make sure that LiveReload 2.3 (or later) or another compatible server is running.
Can anyone help me figure this out as i'd really like to get it working to streamline my workflow.
Thanks
DISCLAIMER: This answer is based on a setup I had working at some point, and by no means is a complete/working answer. But it should give you an alternative to the other tools that exist and get you half way there.
I have not used the tools you are mentioning, but since you are using gulp and aemsync, you could do the following:
In your gulp setup, create a websocket server and basically make that server publish messages everytime aemsync is triggered to push content to AEM.
// start a websocket server
const WebSocket = require('ws'); // requires "npm install ws"
const wss = new WebSocket.Server({ port: 8081 });
const connections = [];
wss.on('connection', function connection(ws) {
connections.push(ws); // keep track of all clients
// send any new messages that come to this server, to all connected clients
ws.on('message', (d) => connections.forEach(connection => connection.send(d)));
});
// create a new websocket to send messages to the websocket server above
const ws = new WebSocket('ws://localhost:8081');
// send a regex to the server every second
// NOTE: CHANGE this to run when aemsync is triggered in your build
setInterval( () => ws.send('reload'), 1000 );
Then in your JS code (on AEM) or really in a <script> tag that you make sure will NOT go beyond your local (or dev/prod) you can setup a websocket listener to refresh the page:
socket = new WebSocket('ws://localhost:8081');
socket.onopen = // add function for when ws is open
socket.onclose = // add function for when ws is closed
socket.onerror = // add function for when ws errors
// listen to messages and reload!
socket.addEventListener('message', function (event) {
location.reload();
});
Alternatively, you could use the chrome plugin I've developed:
https://github.com/ahmed-musallam/websocket-refresh-chrome-ext
It's not perfect by any means. However, for a basic setup, it should work great! an you don't need to touch your AEM JS.
So, I've developed a website (HTML) that has an embedded payment form from Stripe called Checkout. When you visit the website, it prompts you to enter your credit card information, so the checkout form is working correctly.
The issue I'm having is processing the token once it's created.
I'm extremely new to web development and I've never written server code before so please, bear with me.
I've been following guides (Process payments with Node, Vue, Stripe & How to set up Stripe payments with Node.js) and stripes documentation on tokenization to create charges using server-side code (Stripe Checkout)
I understand that I have to have Heroku set up to process the charges so I created an account and set up an app from my terminal. I made a new directory that has the modules required (stripe, express, and bodyParser) and I have this code in my server.js file:
It deploys to Heroku successfully but crashes. This is what is being returned in the console:
What am I doing wrong? Any assistance would be a great help.
You are missing a vital piece:
// Start the server
app.listen(port, function(){
console.log('Server listening on port ' + port)
});
You don't seem to start the server in your application. This should be in the bottom of server.js. You also have to remember to set the port:
var port = process.env.PORT || 3000;
It goes above app.listen of course.
I can't tell for sure if that will fix all your errors, but you have to start with starting the server first.
Also, remember to check for errors in callbacks. In the callback for create you are not doing that. E.g.
if (err){
console.error(err);
res.json({ error: err, charge: false });
} else {
// send response with charge data
res.json({ error: false, charge: charge });
}
You are doing res.send() whether or not there are errors. I doubt that this has anything to do with the Heroku error though.
I am trying to create some karma tests and some of the functions I'm testing are supposed to make Websocket connections.
When running the code normally outside of Karma (using Chrome or Firefox), I see that my console log messages show that ws.onopen() fires as expected.
Not so when running in Karma using PhantomJS or even Chrome. I'm running version 0.12 of Karma. Could this be related to how Karma uses socket.io, instead of the browser's Websocket?
I am not doing anything in regards to manually writing a handshake.
webSocketConnect = function() {
ws = new WebSocket("ws://192.168.103.83:9000", "ws-xyz");
ws.onopen = function(evt) {
console.log("Connection is opened...");
};
};
When webSocketConnect is invoked, i.e.:
webSocketConnect();
I get no error but I don't see "Connection is opened..." in the console log.
Thanks for any help.
Edit: I think that the code is not getting executed because XSS protections are coming into play. I took the code above and started playing around with it in jsfiddle and saw that when I ran it I would get: "
SecurityError: The operation is insecure." I think it's a shame that Karma is not reporting any error. In fact Karma is completely silent and I wasn't even noticing that none of the websocket code was being executed at all.