Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alert to crashed server #113

Open
janat08 opened this issue Jun 11, 2018 · 9 comments
Open

Alert to crashed server #113

janat08 opened this issue Jun 11, 2018 · 9 comments

Comments

@janat08
Copy link

janat08 commented Jun 11, 2018

I believe when you get WebSocket connection to 'wss://localhost:8012/' failed: Error in connection establishment: net::ERR_CONNECTION_CLOSED server has crashed, in which case repainting window to something that indicates that would be quite helpful.

@janat08
Copy link
Author

janat08 commented Jun 11, 2018

Don't know why this is happening, but it's happening out of blue. I start with SSL, and have braintree's drop-in ui package saved, but not imported. If it is imported I get error:

file:C:/Users/janat08/Dev/makpal/node_modules/braintree-web-drop-in/index.js:535
createFromScriptTag(create, typeof document !== 'undefined' && document.querySelector('script[data-braintree-dropin-authorization]')); ^ TypeError: document.querySelector is not a function
    at Object. (file:C:/Users/janat08/Dev/makpal/node_modules/braintree-web-drop-in/index.js:535:73)
    at file:C:/Users/janat08/Dev/makpal/node_modules/braintree-web-drop-in/index.js:546:4
    at file:C:/Users/janat08/Dev/makpal/node_modules/braintree-web-drop-in/index.js:546:98
    at ContextifyScript.Script.runInThisContext (vm.js:50:33)
    at Object.runInThisContext (vm.js:139:38)
    at doEval (C:\Users\janat08\Dev\makpal\node_modules\steal\main.js:4306:10)
    at __eval (C:\Users\janat08\Dev\makpal\node_modules\steal\main.js:4410:7)
    at Loader.exec [as __exec] (C:\Users\janat08\Dev\makpal\node_modules\steal\main.js:2427:5)
    at load.metadata.execute (C:\Users\janat08\Dev\makpal\node_modules\steal\main.js:3392:13)
    at linkDynamicModule (C:\Users\janat08\Dev\makpal\node_modules\steal\main.js:2764:32)

@janat08
Copy link
Author

janat08 commented Jun 11, 2018

develop config:
"develop": "done-serve --develop --port 8080 --proxy http://localhost:8084 --key ../localhost-ssl/server.key --cert ../localhost-ssl/server.cert --proxy-no-cert-check",

@justinbmeyer
Copy link

I mentioned this here: donejs/donejs#318 (comment)

Regarding the document.querySelectorAll, you need to make sure that code does not run while SSR is running. SSR runs against a minimal DOM. Methods like document.querySelector are not supported.

This part of the bitballs guide shows you how to avoid running code during ssr: https://donejs.com/bitballs.html#turn-off-ssr

@janat08
Copy link
Author

janat08 commented Jun 11, 2018

Maybe you could set up proxy for these methods to then send a good error.

@janat08
Copy link
Author

janat08 commented Jun 11, 2018

What about disconnects?

@justinbmeyer
Copy link

cc @matthewp Yeah, we've been thinking about that. As it seems like we are going to support IE11, we can't use proxies. However, we can at least fill out some of the more common ones.

If you'd like to help, you can make that change here: https://github.com/canjs/can-simple-dom/blob/master/lib/simple-dom/document.js

I'd do something like:

function addMissingMethod(name){
  Document.prototype[name] = function(){
    console.warn("document."+name+"() is not implemented in can-simple-dom.  Please make sure this code runs after the document has finished loading."
    return {};
  }
}

addMissingMethod("querySelector");
addMissingMethod("querySelectorAll");

Alternatively, done-ssr makes it possible to load a different virtual DOM. You might be able to get JSDOM working. @matthewp would be able to point you in the right spot.

@janat08
Copy link
Author

janat08 commented Jun 11, 2018

added all of document keys. so what are these disconnects about?

@janat08
Copy link
Author

janat08 commented Jun 12, 2018

WebSocket connection to 'wss://localhost:8012/' failed: Error in connection establishment: net::ERR_CONNECTION_CLOSED

setup | @ | live-reload.js:296
-- | -- | --
  | tryCatchReject | @ | steal.js:1183
  | runContinuation1 | @ | steal.js:1142
  | Fulfilled.when | @ | steal.js:930
  | Pending.run | @ | steal.js:821
  | Scheduler._drain | @ | steal.js:97
  | Scheduler.drain | @ | steal.js:62
  | run | @ | steal.js:268

@janat08
Copy link
Author

janat08 commented Jun 12, 2018

I believe the issue is with ssl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants