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

404 errors on fresh pip install #3309

Closed
paulohubert opened this issue Feb 6, 2018 · 5 comments
Closed

404 errors on fresh pip install #3309

paulohubert opened this issue Feb 6, 2018 · 5 comments

Comments

@paulohubert
Copy link

I have just installed jupyter notebook on a virtual machine on AWS, using a virtual environment. I installed jupyter via pip (version 9.01), which showed no error messages. I'm using Ubuntu 16.04.

After that, if I run "jupyter notebook", I can see the correct notebook dashboard page on lynx text browser. However, when I set the option "jupyter notebook --no-browser" and try to open the URL on Chrome, I get the following errors:

On ubuntu terminal:

404 GET /static/components/preact/preact.min.js.map
404 GET /static/components/preact-compact/preact-compact.min.js.map
404 GET /static/components/prototypes/index.js.map

On Chrome, I get a blank page, and by activating the console I get:

Uncaught ReferenceError: Invalid left-hand side in assignment

The console points me to utils.js line 250, and the line that causes the error seems to be the assignemt in

if (inverse) { [fg, bg] = [bg, fg]; }

Any hints on the cause and possible solutions?
Chrome is able to correctly load jupyter notebooks from other machines, so the issue must be the jupyter installation on my vm.

@takluyver
Copy link
Member

404s for .map files can generally be safely ignored - those files are for Javascript debugging, mapping locations in a minified file back to locations in the readable source.

The error in utils.js does sound more like a problem. That code was added relatively recently by PR #2967. Is it possible that you have an older (<5.3) version of Jupyter notebook on other machines, so you haven't run into the same problem with those?

I'm not sure why you're getting that error. If we'd completely broken the notebook for every Chrome user, we'd have an avalanche of reports about it. Are you using an older version of Chrome? Do you have any extensions installed?

Ping @mgeier , who wrote that code.

@paulohubert
Copy link
Author

Hi @takluyver , thanks for your reply. Including @mgeier as requested.

You are right, I was able to get rid of the 404 errors by just creating empty map files on the correct folders, and it didn't alter the behavior of the dashboard (still didn't work).

I edited notebook/static/edit/js/main.min.js, changing the assignment from

if (inverse) {
    [fg, bg] = [bg, fg];
}

to

if (inverse) {
    tmp = fg; fg = bg; bg = tmp;
}

which got the dashboard working. But I was getting the same error when trying to create or edit notebooks. The chrome console pointed me to notebook/static/base/js/utils.js, which I then edited in the same way as before (changing the assignment). Now everything is working as expected. My guess is that it might have something to do with Javascript version.

My Chrome version is 44.0.2403.125 m. Only extension installed is Docs version 0.0.0.6.
I am running jupyter from a virtual environment, installation via pip. Please indicate whatever information might be useful, I'll be glad to provide it.

@mgeier
Copy link
Contributor

mgeier commented Feb 7, 2018

The assignment with the brackets is an ECMAScript 6 feature called "destructuring assignment", see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment.
This seems to be supported since Chrome version 49.

I don't know if the Jupyter Notebook is supposed to support ES6, I thought it did.
If not, the fix mentioned above is quite trivial, probably there should be added a var at the beginning of the line?

@takluyver
Copy link
Member

I don't think we aim for a specific JS version, because some ES6 features are much more readily available than others. We should ensure it works on reasonably recent versions of the browsers we support (Firefox, Chrome, Safari), including any extended support releases that might reasonably still be in use.

I don't think we need to support Chrome 44, which is from over 2 years ago, unless some significant group are going to be stuck on it, because it's the last version compatible with... something.

@paulohubert as it sounds like that's the only issue preventing it working at the moment, if you want to make a PR, we'll probably ship at with the next release. But something else might break it again, so upgrading your browser is the best option if possible. It's a good idea anyway, because old browser versions may have serious security issues.

@paulohubert
Copy link
Author

Thank you @takluyver and @mgeier. I'll upgrade Chrome as you suggested. Don't think it deserves a PR, though. Thanks again.

@minrk minrk added this to the Reference milestone Jun 15, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants