facebook / create-react-app

Set up a modern web app by running one command.
https://create-react-app.dev
MIT License
102.71k stars 26.84k forks source link

Blank Page on Hyperledger Explorer #4459

Closed srikanthpdpl closed 6 years ago

srikanthpdpl commented 6 years ago

Facing Blank page on Hyperledger Explorer

main.da479199.js:sourcemap:1 Error during service worker registration: DOMException: Only secure origins are allowed (see: https://goo.gl/Y0ZkNV). (anonymous) @ main.da479199.js:sourcemap:1 :8080/#/:1 WebSocket connection to 'ws://localhost:8080/' failed: WebSocket is closed before the connection is established. main.da479199.js:sourcemap:1 TypeError: Cannot read property 'forEach' of undefined at t.value (main.da479199.js:sourcemap:1) at commitLifeCycles (main.da479199.js:sourcemap:1) at O (main.da479199.js:sourcemap:1) at M (main.da479199.js:sourcemap:1) at m (main.da479199.js:sourcemap:1) at v (main.da479199.js:sourcemap:1) at h (main.da479199.js:sourcemap:1) at l (main.da479199.js:sourcemap:1) at Object.enqueueSetState (main.da479199.js:sourcemap:1) at t.o.setState (main.da479199.js:sourcemap:1) _t @ main.da479199.js:sourcemap:1 main.da479199.js:sourcemap:1 Uncaught TypeError: Cannot read property 'forEach' of undefined at t.value (main.da479199.js:sourcemap:1) at commitLifeCycles (main.da479199.js:sourcemap:1) at O (main.da479199.js:sourcemap:1) at M (main.da479199.js:sourcemap:1) at m (main.da479199.js:sourcemap:1) at v (main.da479199.js:sourcemap:1) at h (main.da479199.js:sourcemap:1) at l (main.da479199.js:sourcemap:1) at Object.enqueueSetState (main.da479199.js:sourcemap:1) at t.o.setState (main.da479199.js:sourcemap:1)

Config File:

{ "network-config": { "org1": { "name": "peerOrg1", "mspid": "Org1MSP", "peer1": { "requests": "grpcs://127.0.0.1:7051", "events": "grpcs://127.0.0.1:7053", "server-hostname": "peer0.org1.example.com", "tls_cacerts": "/home/ubuntu/fabric-dev-servers/fabric-scripts/hlfv1/composer/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt" }, "admin": { "key": "/home/ubuntu/fabric-dev-servers/fabric-scripts/hlfv1/composer/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore", "cert": "/home/ubuntu/fabric-dev-servers/fabric-scripts/hlfv1/composer/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts" } } }, "host": "localhost", "port": "8080", "channel": "mychannel", "keyValueStore": "/tmp/fabric-client-kvs", "eventWaitTime": "30000", "users":[ { "username":"admin", "secret":"adminpw" } ], "pg": { "host": "127.0.0.1", "port": "5432", "database": "fabricexplorer", "username": "hppoc", "passwd": "password" }, "license": "Apache-2.0" }

DouDouLee commented 6 years ago

I ran into the same issue

mustafa-kmindz commented 6 years ago

Same Issue !!!

pradeeppadmarajaiah commented 6 years ago

same issue with hyperledger-composer setup with explorer as well

Timer commented 6 years ago

I'm not sure there's enough information here for us to help you. Can you please provide more context?

srikanthpdpl commented 6 years ago

Hi Timer

We are trying to install Hyperledger explorer from the below mentioned URL : https://github.com/hyperledger/blockchain-explorer

after installation when we try to lauch the application on browser it giving blank page.

Please let me know if you need more details

Timer commented 6 years ago

It might not support service workers, if you remove the service worker registration from your app does it work?

srikanthpdpl commented 6 years ago

Hi Timer Sorry, I am new to this. Please can you explain in detail. I am not able to understand it.

Thanks Srikanth

bugzpodder commented 6 years ago

@srikanthpdpl can you show your index.js specifically anyline that contains serviceWorker?

srikanthpdpl commented 6 years ago

@bugzpodder here is the link for index.js https://github.com/hyperledger/blockchain-explorer/blob/master/client/src/index.js

Timer commented 6 years ago

Please give us reproduction steps, are you npm run building then opening index.html? What browser are you opening it in?

bathejasumeet commented 6 years ago

Having same problem.

Reproduction steps -

launching on localhost:8080, blank page, browser console o/p :

WebSocket connection to 'ws://localhost:8080/' failed: WebSocket is closed before the connection is established.
HeaderView.js:67 Uncaught TypeError: Cannot read property 'forEach' of undefined
    at t.value (HeaderView.js:67)
    at commitLifeCycles (react-dom.production.min.js:159)
    at O (react-dom.production.min.js:185)
    at M (react-dom.production.min.js:182)
    at m (react-dom.production.min.js:181)
    at v (react-dom.production.min.js:181)
    at h (react-dom.production.min.js:180)
    at l (react-dom.production.min.js:179)
    at Object.enqueueSetState (react-dom.production.min.js:110)
    at t.o.setState (react.production.min.js:12)

the config.json file -

{
  "network-config": {
    "org1": {
      "name": "peerOrg1",
      "mspid": "Org1MSP",
      "peer1": {
        "requests": "grpc://127.0.0.1:7051",
        "events": "grpc://127.0.0.1:7053",
        "server-hostname": "peer0.org1.example.com"
      },
      "admin": {
        "key": "/Users/Sumeet/fabric-dev-servers/fabric-scripts/hlfv11/composer/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/keystore",
        "cert": "/Users/Sumeet/fabric-dev-servers/fabric-scripts/hlfv11/composer/crypto-config/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp/signcerts",
        "tls_cacerts": "/Users/Sumeet/fabric-dev-servers/fabric-scripts/hlfv11/composer/crypto-config/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt"

      }
    }
  },
  "host": "localhost",
  "port": "8080",
  "channel": "composerchannel",
  "keyValueStore": "/tmp/fabric-client-kvs",
  "eventWaitTime": "30000",
  "users": [{
    "username": "admin",
    "secret": "adminpw"
  }],
  "pg": {
    "host": "127.0.0.1",
    "port": "5432",
    "database": "fabricexplorer",
    "username": "postgres",
    "passwd": "sumeet"
  },
  "license": "Apache-2.0"
}
bugzpodder commented 6 years ago

Thanks for the repo. This is a problem with the hyperledge-explorer implementation of its client app. Firstly if you don't need service worker consider taking out the line: https://github.com/hyperledger/blockchain-explorer/blob/master/client/src/index.js#L25 Also, from your error logs it appears that this line is breaking the app: https://github.com/hyperledger/blockchain-explorer/blob/master/client/src/components/Header/HeaderView.js#L67 Please double check your configs and raise an issue with hyperledge-explorer maintainers as this is a bug in their code.