SAFE Developer Hub (https://hub.safedev.org)

thnk you - on a conf call right now for RealJob but I’ll attend to this ASAP

Thank you for excellent quick response

1 Like

Hi @bochaco

Yes I do get a network error - amongst others

I am running:
willie@sputnik:~/projects/safe/safe_examples/safe_web_app_quick_start$ echo NODE_ENV dev willie@sputnik:~/projects/safe/safe_examples/safe_web_app_quick_start npm start

safe_web_app_quick_start@1.0.0 start /home/willie/projects/safe/safe_examples/safe_web_app_quick_start
neutrino start

:heavy_check_mark: Development server running on: http://localhost:5000
:heavy_check_mark: Build completed

This authenticates OK but shows 0 trips - I get the following in the console

Uncaught (in promise) Error: Unexpected (probably a logic error): Could not connect to the SAFE Network
at module.exports (/home/willie/projects/safe/safe-browser-mock-v0.10.2-linux-x64/resources/app/node_modules/@maidsafe/safe-node-app/src/native/_error.js:19:10)
at ffi.Callback (/home/willie/projects/safe/safe-browser-mock-v0.10.2-linux-x64/resources/app/node_modules/@maidsafe/safe-node-app/src/native/_app.js:63:22)
at /home/willie/projects/safe/safe-browser-mock-v0.10.2-linux-x64/resources/app/node_modules/ffi/lib/callback.js:66:25
at Function.proxy (/home/willie/projects/safe/safe-browser-mock-v0.10.2-linux-x64/resources/app/node_modules/ffi/lib/_foreign_function.js:59:14)
at Promise (/home/willie/projects/safe/safe-browser-mock-v0.10.2-linux-x64/resources/app/node_modules/@maidsafe/safe-node-app/src/native/_app.js:72:14)
at Promise ()
at Object.app_registered (/home/willie/projects/safe/safe-browser-mock-v0.10.2-linux-x64/resources/app/node_modules/@maidsafe/safe-node-app/src/native/_app.js:59:16)
at lib.decode_ipc_msg.then (/home/willie/projects/safe/safe-browser-mock-v0.10.2-linux-x64/resources/app/node_modules/@maidsafe/safe-node-app/src/api/auth.js:366:22)
at
17:24:10.133 p/:1 XMLHttpRequest cannot load http://localhost:5000/sockjs-node/info?t=1524846250129. The value of the ‘Access-Control-Allow-Origin’ header in the response must not be the wildcard ‘’ when the request’s credentials mode is ‘include’. Origin ‘localhost://p:5000’ is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
17:24:18.176 p/:1 XMLHttpRequest cannot load http://localhost:5000/sockjs-node/info?t=1524846258169. The value of the ‘Access-Control-Allow-Origin’ header in the response must not be the wildcard '
’ when the request’s credentials mode is ‘include’. Origin ‘localhost://p:5000’ is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
17:24:34.200 p/:1 XMLHttpRequest cannot load http://localhost:5000/sockjs-node/info?t=1524846274195. The value of the ‘Access-Control-Allow-Origin’ header in the response must not be the wildcard ‘’ when the request’s credentials mode is ‘include’. Origin ‘localhost://p:5000’ is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
17:24:46.904 p/:1 Uncaught (in promise) Error: Setup Incomplete. Connection not available yet.
at module.exports (/home/willie/projects/safe/safe-browser-mock-v0.10.2-linux-x64/resources/app/node_modules/@maidsafe/safe-node-app/src/native/_error.js:19:10)
at SAFEApp.get connection [as connection] (/home/willie/projects/safe/safe-browser-mock-v0.10.2-linux-x64/resources/app/node_modules/@maidsafe/safe-node-app/src/app.js:319:13)
at MutableDataInterface.newMutation (/home/willie/projects/safe/safe-browser-mock-v0.10.2-linux-x64/resources/app/node_modules/@maidsafe/safe-node-app/src/api/mutable.js:620:48)
at /home/willie/projects/safe/safe-browser-mock-v0.10.2-linux-x64/resources/app/node_modules/beaker-plugin-safe-app/dist/api.js:2628:32
at
17:25:06.235 p/:1 XMLHttpRequest cannot load http://localhost:5000/sockjs-node/info?t=1524846306229. The value of the ‘Access-Control-Allow-Origin’ header in the response must not be the wildcard '
’ when the request’s credentials mode is ‘include’. Origin ‘localhost://p:5000’ is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
17:26:10.292 p/:1 XMLHttpRequest cannot load http://localhost:5000/sockjs-node/info?t=1524846370287. The value of the ‘Access-Control-Allow-Origin’ header in the response must not be the wildcard ‘*’ when the request’s credentials mode is ‘include’. Origin ‘localhost://p:5000’ is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.

Ok, perhaps it’s the same error I think I ran into a few times, that we need to look into.
Could you please try removing the mock file /tmp/MockVault and launching the browser again, create a new account and try again to load the app?

1 Like

OK I’ll give that a go
remove /tmp/MockVault
restart Safe Browser (mock) and make new acct
restart app

seems to be much the same…

[HMR] Waiting for update signal from WDS…
18:47:03.637 webpack-internal:///./src/safenetwork.js:20 Authorising SAFE application…
18:47:03.638 webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:8009 Download the Vue Devtools extension for a better development experience:

18:47:03.639 webpack-internal:///./node_modules/vue/dist/vue.runtime.esm.js:8020 You are running Vue in development mode.
Make sure to turn on production mode when deploying for production.
See more tips at Production Deployment — Vue.js
18:47:03.643 p/:1 XMLHttpRequest cannot load http://localhost:5000/sockjs-node/info?t=1524851223640. The value of the ‘Access-Control-Allow-Origin’ header in the response must not be the wildcard ‘’ when the request’s credentials mode is ‘include’. Origin ‘localhost://p:5000’ is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
18:47:03.645 client?0485:176 [WDS] Disconnected!
close @ client?0485:176
18:47:04.748 p/:1 XMLHttpRequest cannot load http://localhost:5000/sockjs-node/info?t=1524851224743. The value of the ‘Access-Control-Allow-Origin’ header in the response must not be the wildcard '
’ when the request’s credentials mode is ‘include’. Origin ‘localhost://p:5000’ is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
18:47:06.845 p/:1 Uncaught (in promise) Error: Unexpected (probably a logic error): Could not connect to the SAFE Network
at module.exports (/home/willie/projects/safe/safe-browser-mock-v0.10.2-linux-x64/resources/app/node_modules/@maidsafe/safe-node-app/src/native/_error.js:19:10)
at ffi.Callback (/home/willie/projects/safe/safe-browser-mock-v0.10.2-linux-x64/resources/app/node_modules/@maidsafe/safe-node-app/src/native/_app.js:63:22)
at /home/willie/projects/safe/safe-browser-mock-v0.10.2-linux-x64/resources/app/node_modules/ffi/lib/callback.js:66:25
at Function.proxy (/home/willie/projects/safe/safe-browser-mock-v0.10.2-linux-x64/resources/app/node_modules/ffi/lib/_foreign_function.js:59:14)
at Promise (/home/willie/projects/safe/safe-browser-mock-v0.10.2-linux-x64/resources/app/node_modules/@maidsafe/safe-node-app/src/native/_app.js:72:14)
at Promise ()
at Object.app_registered (/home/willie/projects/safe/safe-browser-mock-v0.10.2-linux-x64/resources/app/node_modules/@maidsafe/safe-node-app/src/native/_app.js:59:16)
at lib.decode_ipc_msg.then (/home/willie/projects/safe/safe-browser-mock-v0.10.2-linux-x64/resources/app/node_modules/@maidsafe/safe-node-app/src/api/auth.js:366:22)
at
18:47:06.855 p/:1 XMLHttpRequest cannot load http://localhost:5000/sockjs-node/info?t=1524851226849. The value of the ‘Access-Control-Allow-Origin’ header in the response must not be the wildcard ‘’ when the request’s credentials mode is ‘include’. Origin ‘localhost://p:5000’ is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
18:47:10.897 p/:1 XMLHttpRequest cannot load http://localhost:5000/sockjs-node/info?t=1524851230893. The value of the ‘Access-Control-Allow-Origin’ header in the response must not be the wildcard '
’ when the request’s credentials mode is ‘include’. Origin ‘localhost://p:5000’ is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
18:47:18.926 p/:1 XMLHttpRequest cannot load http://localhost:5000/sockjs-node/info?t=1524851238920. The value of the ‘Access-Control-Allow-Origin’ header in the response must not be the wildcard ‘’ when the request’s credentials mode is ‘include’. Origin ‘localhost://p:5000’ is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
18:47:18.926 sockjs.js?3600:1601 XHR failed loading: GET “http://localhost:5000/sockjs-node/info?t=1524851238920”.
AbstractXHRObject._start @ sockjs.js?3600:1601
(anonymous) @ sockjs.js?3600:1490
18:47:34.964 p/:1 XMLHttpRequest cannot load http://localhost:5000/sockjs-node/info?t=1524851254961. The value of the ‘Access-Control-Allow-Origin’ header in the response must not be the wildcard '
’ when the request’s credentials mode is ‘include’. Origin ‘localhost://p:5000’ is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
18:47:34.964 sockjs.js?3600:1601 XHR failed loading: GET “http://localhost:5000/sockjs-node/info?t=1524851254961”.
AbstractXHRObject._start @ sockjs.js?3600:1601
(anonymous) @ sockjs.js?3600:1490

Ok, I’ll text you early next week and we can go on a HO to troubleshoot it. For some weird reason you are not able to connect to the mocked net. You can also try with the alpha2 network using the non-mock browser as well, it should work.

1 Like

thank you
I’ll try it using the non-mock browser meantime.
Be interesting to see how many folks have run through this tutorial without issues. - What did they do that I didn’t?

Using Debian 9, node v8.11.1, npm v5.6.0 it fails for me at $ npm install @maidsafe/safe-node-app --save

user@user1:~/safe_examples/safe_app_electron_quick_start $ npm install @maidsafe/safe-node-app --save
npm WARN deprecated graceful-fs@3.0.11: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated natives@1.1.3: This module relies on Node.js's internals and will break at some point. Do not use it, and update to graceful-fs@4.x.

> ref@1.3.5 install /home/user/safe_examples/safe_app_electron_quick_start/node_modules/ref
> node-gyp rebuild

gyp ERR! build error 
gyp ERR! stack Error: not found: make
gyp ERR! stack     at getNotFoundError (/usr/lib/node_modules/npm/node_modules/which/which.js:13:12)
gyp ERR! stack     at F (/usr/lib/node_modules/npm/node_modules/which/which.js:68:19)
gyp ERR! stack     at E (/usr/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack     at /usr/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack     at /usr/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /usr/lib/node_modules/npm/node_modules/which/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Linux 4.9.0-4-amd64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/user/safe_examples/safe_app_electron_quick_start/node_modules/ref
gyp ERR! node -v v8.11.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ref@1.3.5 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the ref@1.3.5 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/user/.npm/_logs/2018-04-28T11_38_10_445Z-debug.log

OK I got a bit further by installing yarn and build-essential

But now I get $ npm install @maidsafe/safe-node-app --save

ERROR: [Errno 2] No such file or directory: 'run'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @maidsafe/safe-node-app@0.8.1 postinstall: `yarn run install-prod && node install-dev-libs.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @maidsafe/safe-node-app@0.8.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/user/.npm/_logs/2018-04-28T11_50_52_927Z-debug.log

Relevant part of the log (I think):

334 verbose pkgid @maidsafe/safe-node-app@0.8.1
335 verbose cwd /home/user/safe_examples/safe_app_electron_quick_start
336 verbose Linux 4.9.0-4-amd64
337 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "@maidsafe/safe-node-app" "--save"
338 verbose node v8.11.1
339 verbose npm  v5.6.0
340 error code ELIFECYCLE
341 error errno 1
342 error @maidsafe/safe-node-app@0.8.1 postinstall: `yarn run install-prod && node install-dev-libs.js`
342 error Exit status 1
343 error Failed at the @maidsafe/safe-node-app@0.8.1 postinstall script.
343 error This is probably not a problem with npm. There is likely additional logging output above.
344 verbose exit [ 1, true ]

Perhaps all the documentation under docs.maidsafe.net could be merged into the devhub instead of having two separate websites.

8 Likes

I’ll try to setup a Debian 9, but I tihnk you are right it’s all related to npm/yarn versions, I’ll try to find out which is the minimum reqs around the versions. I’ve been having this type of problems recently with other projects with npm vs. yarn.

1 Like

sorry if I missed it, but I don’t think this is linked in the website. Would be great if new visitors could find this great resource easily :slight_smile:

Recently, I had to upgrade to Debian “testing” in order for safe_authenticator to compile without error.

I have got it working on Debian 9 now installing build-essential, updating npm to 6.0.0 and updating yarn via npm. Not sure which of these solved the problem I was having, but my guess is the yarn update.

3 Likes

I too did a yarn update but npm and node need to be the latest as well
On Debian type distros, (Im on 18.04 beta) you are always going to need build-essential for anything interesting.

So which versions of npm and node are you using?

 NPM version
6.0.0

node version
v9.11.1

Try my utterly trivial wee version tool

3 Likes

Hey thanks - upgrading to node v9.11.1 worked. :+1:

3 Likes

Thanks @JPL, @Southside for all the info. Based on your feedback from last week, we have updated the tutorials to recommend using node v8.11.1 (which comes with npm v5.6.0) which is also the version recommended on the nodejs site. From my tests that version works fine on Debian 8 and 9.4, so it seems the problem you faced were related to actually using some version of yarn.

On the other hand, in the tutorials we are not suggesting the use of yarn but just npm, and it was effectively to avoid the need to have an additional dependency, to keep it as simple as possible. I’ll see if I add a comment mentioning that using yarn is totally optional and recommend a version for it which works with nodejs v8.11.1, but users don’t really need yarn for quick starting, specially if they are new to nodejs/npm.

4 Likes

My community friends…

I’ve created a new topic to keep all future DevHub feedback items/suggestions here.

I’m going to be ‘on-point’ for this one if you want to address the feedback to me (or not… up to you :smiley:).

Closing off this one now.
David.


1 Like