apollo icon indicating copy to clipboard operation
apollo copied to clipboard

Dreamview is blank page in chrome

Open trooperli opened this issue 7 years ago • 13 comments

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 14.04): 14.04
  • Apollo installed from (source or binary): source
  • Apollo version (1.0, 1.5, 2.0, 2.5, 3.0): 3.5

Steps to reproduce the issue:

  • Please use bullet points and include as much details as possible: Follow the instructions given in https://github.com/ApolloAuto/apollo/blob/master/docs/howto/how_to_launch_Apollo.md

When browsing dreamview at localhost:8888 in chrome, I got a blank page while it can be shown in firefox with problem "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:5001/. (Reason: CORS request did not succeed)".

This is similar to #6479 and #6467. I tried the solution in #6479 but it didn't work for me.

Supporting materials (screenshots, command lines, code/script snippets):

Please see attachment for localhost:8888 in chrome and firefox, respectively. screenshot from 2019-01-15 15 17 02 screenshot from 2019-01-15 15 17 31

trooperli avatar Jan 15 '19 23:01 trooperli

Can you take a look at the developer console of Chrome when seeing such a blank page? Additionally, can you check this file https://github.com/ApolloAuto/apollo/blob/master/modules/dreamview/frontend/dist/app.bundle.js in your local to make sure git lfs has pulled it correctly?

siyangy avatar Jan 15 '19 23:01 siyangy

Can you take a look at the developer console of Chrome when seeing such a blank page? Additionally, can you check this file https://github.com/ApolloAuto/apollo/blob/master/modules/dreamview/frontend/dist/app.bundle.js in your local to make sure git lfs has pulled it correctly?

Hi Siyangy, From the console I got the following error:

Loading Json file: parameters.json
(index):15 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
loadJSON @ (index):15
(index):23 Failed to load resource: the server responded with a status of 404 (Not Found)
loadJSON @ (index):23
app.bundle.js:1 Uncaught SyntaxError: Unexpected identifier

I have app.bundle.js under apollo/modules/dreamview/frontend, its content is shown below:

version https://git-lfs.github.com/spec/v1 oid sha256:dff876ee66ff3b341478466f2631fb0d638e067969cf4c3ce72a79fca2564d8b size 1821795

Thanks for your help!

trooperli avatar Jan 15 '19 23:01 trooperli

This does seem to be caused by git lfs, when being downloaded correctly, the file should be with its real content instead of just meta information as you are seeing.

siyangy avatar Jan 15 '19 23:01 siyangy

Could you try """ bazel clean git lfs fetch """ and then build again before running the bootstrap.sh?

Thanks!

xiaoxq avatar Jan 15 '19 23:01 xiaoxq

This does seem to be caused by git lfs, when being downloaded correctly, the file should be with its real content instead of just meta information as you are seeing.

In chrome developer console, I could see the source as following:

<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Dreamview</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script>
      loadJSON('parameters.json', (response) => {
        window.PARAMETERS = JSON.parse(response);
      });
      function loadJSON(jsonFilePath, callback) {
        console.log("Loading Json file:", jsonFilePath);
        const xobj = new XMLHttpRequest();
        xobj.overrideMimeType('application/json');
        xobj.open('GET', jsonFilePath, false /* synchronous */);
        xobj.onreadystatechange = () => {
          if (xobj.readyState === 4 && xobj.status === 200) {
            // Required use of an anonymous callback as .open will NOT
            // return a value but simply returns undefined in asynchronous mode
            callback(xobj.responseText);
          }
        };
        xobj.send(null);
      }
    </script>
  <link rel="apple-touch-icon" sizes="57x57" href="/icons-35549e149c746afd95464c71b413b5e9/apple-touch-icon-57x57.png"><link rel="apple-touch-icon" sizes="60x60" href="/icons-35549e149c746afd95464c71b413b5e9/apple-touch-icon-60x60.png"><link rel="apple-touch-icon" sizes="72x72" href="/icons-35549e149c746afd95464c71b413b5e9/apple-touch-icon-72x72.png"><link rel="apple-touch-icon" sizes="76x76" href="/icons-35549e149c746afd95464c71b413b5e9/apple-touch-icon-76x76.png"><link rel="apple-touch-icon" sizes="114x114" href="/icons-35549e149c746afd95464c71b413b5e9/apple-touch-icon-114x114.png"><link rel="apple-touch-icon" sizes="120x120" href="/icons-35549e149c746afd95464c71b413b5e9/apple-touch-icon-120x120.png"><link rel="apple-touch-icon" sizes="144x144" href="/icons-35549e149c746afd95464c71b413b5e9/apple-touch-icon-144x144.png"><link rel="apple-touch-icon" sizes="152x152" href="/icons-35549e149c746afd95464c71b413b5e9/apple-touch-icon-152x152.png"><link rel="apple-touch-icon" sizes="180x180" href="/icons-35549e149c746afd95464c71b413b5e9/apple-touch-icon-180x180.png"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"><meta name="apple-mobile-web-app-title" content="dreamview"><link rel="icon" type="image/png" sizes="32x32" href="/icons-35549e149c746afd95464c71b413b5e9/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/icons-35549e149c746afd95464c71b413b5e9/favicon-16x16.png"><link rel="shortcut icon" href="/icons-35549e149c746afd95464c71b413b5e9/favicon.ico"><meta name="mobile-web-app-capable" content="yes"><meta name="theme-color" content="#fff"><meta name="application-name" content="dreamview"><link rel="apple-touch-startup-image" media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 1)" href="/icons-35549e149c746afd95464c71b413b5e9/apple-touch-startup-image-320x460.png"><link rel="apple-touch-startup-image" media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 2)" href="/icons-35549e149c746afd95464c71b413b5e9/apple-touch-startup-image-640x920.png"><link rel="apple-touch-startup-image" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)" href="/icons-35549e149c746afd95464c71b413b5e9/apple-touch-startup-image-640x1096.png"><link rel="apple-touch-startup-image" media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2)" href="/icons-35549e149c746afd95464c71b413b5e9/apple-touch-startup-image-750x1294.png"><link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 736px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 3)" href="/icons-35549e149c746afd95464c71b413b5e9/apple-touch-startup-image-1182x2208.png"><link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 736px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 3)" href="/icons-35549e149c746afd95464c71b413b5e9/apple-touch-startup-image-1242x2148.png"><link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 1)" href="/icons-35549e149c746afd95464c71b413b5e9/apple-touch-startup-image-748x1024.png"><link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 1)" href="/icons-35549e149c746afd95464c71b413b5e9/apple-touch-startup-image-768x1004.png"><link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 2)" href="/icons-35549e149c746afd95464c71b413b5e9/apple-touch-startup-image-1496x2048.png"><link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)" href="/icons-35549e149c746afd95464c71b413b5e9/apple-touch-startup-image-1536x2008.png"></head>
  <body>
    <div id="root"></div>
  <script type="text/javascript" src="/app.bundle.js"></script></body>
</html>

trooperli avatar Jan 15 '19 23:01 trooperli

Could you try """ bazel clean git lfs fetch """ and then build again before running the bootstrap.sh?

Thanks!

Hi xiaoxq, I followed your solution still got the same problem...

trooperli avatar Jan 16 '19 02:01 trooperli

I can also confirm that I am still having the same problem on Chrome 71.0.3578.98 and Firefox on Ubuntu 18.10, followed the below steps based on 6479

$ cd apollo-repo/
$ ~/apollo-repo$ git lfs fetch --all

followed with dev_start and dev_into, and rebuild.

But the app.bundle.js is still only showing metadata and not the actual content.

samehmohamed88 avatar Jan 16 '19 12:01 samehmohamed88

The problem for me (and I expect for some others) was that git lfs was not initialized. So in summary:

git clone https://github.com/ApolloAuto/apollo.git
# you only have to do this one time,
# if you have never used git lfs, then that's why it's not working
git lfs install
git lfs fetch --all

You can now confirm that app.bundle.js is actual content

$ cat modules/dreamview/frontend/dist/app.bundle.js

Will be actual js code and not git lfs metadata

samehmohamed88 avatar Jan 16 '19 19:01 samehmohamed88

The problem for me (and I expect for some others) was that git lfs was not initialized. So in summary:

git clone https://github.com/ApolloAuto/apollo.git
# you only have to do this one time,
# if you have never used git lfs, then that's why it's not working
git lfs install
git lfs fetch --all

You can now confirm that app.bundle.js is actual content

$ cat modules/dreamview/frontend/dist/app.bundle.js

Will be actual js code and not git lfs metadata

I followed your solution and now I could see app.bundle.js is actually code and I did the rebuild, still it is blank page in chrome.

trooperli avatar Jan 17 '19 01:01 trooperli

Now I can see that app.bundle.js is code but when I check the developer console in chrome, the source code is still metadata shown below:

version https://git-lfs.github.com/spec/v1
oid sha256:dff876ee66ff3b341478466f2631fb0d638e067969cf4c3ce72a79fca2564d8b
size 1821795

How could I solve this issue? Thanks!

trooperli avatar Jan 17 '19 18:01 trooperli

Did you run bootstrap again after you re-built?

If not, you can try this: it maybe overkill, but I would stop existing containers using:

# warning: this will stop and remove all running containers
$ docker stop `docker ps -qa`
$ docker rm `docker ps -qa`

Then do the dev_start and re-build

$ bash docker/scripts/dev_start.sh
$ bash docker/scripts/dev_into.sh
$ bash apollo.sh build_cpu # or just build with GPU
$ bash scripts/bootstrap.sh
# go to http://localhost:8888

samehmohamed88 avatar Jan 17 '19 18:01 samehmohamed88

The problem is indeed caused by git lfs. Just follow aboarya's solution:

 git clone https://github.com/ApolloAuto/apollo.git
# you only have to do this one time,
# if you have never used git lfs, then that's why it's not working
git lfs install
git lfs fetch --all

And then rebuild. The reason that I did not succeed in the first place is because somehow the nividia driver was not installed in docker. Please make sure nvidia-smi works under docker environment.

trooperli avatar Jan 17 '19 18:01 trooperli

@trooperli

 git-lfs fetch --all
fetch: 1513 object(s) found, done                                                                                                                                                  
fetch: Fetching all references...

Is this fetched? same output with git lfs fetch --all, but the file still just meta not actually one

lucasjinreal avatar Feb 12 '19 06:02 lucasjinreal