bnhansn / sling Goto Github PK
View Code? Open in Web Editor NEWSlack clone built with Elixir, Phoenix, and React
Home Page: http://sling-chat.s3-website-us-west-2.amazonaws.com
Slack clone built with Elixir, Phoenix, and React
Home Page: http://sling-chat.s3-website-us-west-2.amazonaws.com
11:51:40.679 session.js:25 Uncaught TypeError: Cannot read property 'replace' of undefined
at eval (session.js:25)
at Object.<anonymous> (bundle.js:5080)
at __webpack_require__ (bundle.js:556)
at fn (bundle.js:87)
at eval (index.js:21)
at Object.<anonymous> (bundle.js:4747)
at __webpack_require__ (bundle.js:556)
at fn (bundle.js:87)
at eval (index.js:19)
at Object.<anonymous> (bundle.js:1363
I've registered on the demo website (http://sling-chat.s3-website-us-west-2.amazonaws.com/), creating and joining a room works perfectly, however I'm unable to send any messages.
I am getting the following: "no route found for GET / (Sling.Router)" in web/router.ex
Occurring when I test at the instruction "If you open up http://localhost:4000 you should see the Phoenix welcome page."
This is just after configuring the server, creating the db, just before the second instruction to git commit.
I've carefully gone through the instructions a few times to make sure I wasn't making a mistake. Possible I'm still doing something wrong.
Rebuilding from scratch by rebuilding at home, and signing up/logging in gives this error:
[info] OPTIONS /api/users
[debug] ** (Phoenix.Router.NoRouteError) no route found for OPTIONS /api/users (Sling.Router)
Any ideas where to start with this issue?
Stack:
Phoenix 1.3 Elixir 1.6 Erlang/OTP 20
Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false]
Interactive Elixir (1.6.0) - press Ctrl+C to exit (type h() ENTER for help)
$ node -v
v8.9.4
$ npm view react version
16.2.0
$ npm view react-router version
4.2.0
$ npm view redux version
3.7.2
$ npm view redux-thunk version
2.2.0
$ npm view redux-form version
7.2.3
$ npm view aphrodite version
1.2.5```
Using these latest packages, ```npm start``` produces this in the browser:
```TypeError: Cannot read property 'object' of undefined
./node_modules/react-broadcast/Broadcast.js
node_modules/react-broadcast/Broadcast.js:104
101 | }(_react2.default.Component);
102 |
103 | Broadcast.contextTypes = {
> 104 | broadcasts: _react.PropTypes.object
105 | };
106 | Broadcast.childContextTypes = {
107 | broadcasts: _react.PropTypes.object.isRequired
View compiled
__webpack_require__
/data/git/sling/web/webpack/bootstrap 84d4f895ef3293cb2ab4:678
675 | };
676 |
677 | // Execute the module function
> 678 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
679 |
680 | // Flag the module as loaded
681 | module.l = true;
View compiled
fn
/data/git/sling/web/webpack/bootstrap 84d4f895ef3293cb2ab4:88
85 | console.warn("[HMR] unexpected require(" + request + ") from disposed module " + moduleId);
86 | hotCurrentParents = [];
87 | }
> 88 | return __webpack_require__(request);
89 | };
90 | var ObjectFactory = function ObjectFactory(name) {
91 | return {
View compiled
./node_modules/react-broadcast/index.js
node_modules/react-broadcast/index.js:6
3 | exports.__esModule = true;
4 | exports.Subscriber = exports.Broadcast = undefined;
5 |
> 6 | var _Broadcast2 = require('./Broadcast');
7 |
8 | var _Broadcast3 = _interopRequireDefault(_Broadcast2);
9 |
View compiled
__webpack_require__
/data/git/sling/web/webpack/bootstrap 84d4f895ef3293cb2ab4:678
675 | };
676 |
677 | // Execute the module function
> 678 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
679 |
680 | // Flag the module as loaded
681 | module.l = true;
View compiled
fn
/data/git/sling/web/webpack/bootstrap 84d4f895ef3293cb2ab4:88
85 | console.warn("[HMR] unexpected require(" + request + ") from disposed module " + moduleId);
86 | hotCurrentParents = [];
87 | }
> 88 | return __webpack_require__(request);
89 | };
90 | var ObjectFactory = function ObjectFactory(name) {
91 | return {
View compiled
./node_modules/react-router/Broadcasts.js
node_modules/react-router/Broadcasts.js:12
...```
Opening the demo in Safari returns this error:
WebSocket connection to 'ws://nameless-reaches-32969.herokuapp.com/socket/websocket?token=<token> failed: Unexpected response code: 301
This might be an issue with the force_ssl
option, Heroku, or nginx configuration. I tried removing force_ssl
, but then Safari returned a 403 error and the application logs printed this message:
This happens when you are attempting a socket connection to
a different host than the one configured in your config/
files. For example, in development the host is configured
to "localhost" but you may be trying to access it from
"127.0.0.1". To fix this issue, you may either:
1. update [url: [host: ...]] to your actual host in the
config file for your current environment (recommended)
2. pass the :check_origin option when configuring your
endpoint or when configuring the transport in your
UserSocket module, explicitly outlining which origins
are allowed:
check_origin: ["https://example.com",
"//another.com:888", "//other.com"]
I haven't decided if I should attempt one of those solutions yet, as I don't really want to disable force_ssl in the first place. I would like this demo to simulate a production app as much as possible. Because it is transmitting user login information, disabling ssl is a security risk.
Possible solutions: Adding ssl to frontend (free Cloudflare option?), adding custom domain, altering nginx configuration?
Sending a long message like the following causes the chat area to get really wide and wonky, instead of wrapping.
testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttest
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.