Skip to content

Error loading react-dom@15.4.2 #114

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

Closed
radumas opened this issue Aug 16, 2017 · 7 comments
Closed

Error loading react-dom@15.4.2 #114

radumas opened this issue Aug 16, 2017 · 7 comments

Comments

@radumas
Copy link

radumas commented Aug 16, 2017

I've deployed a Dash app to Heroku and the page was loading fine on my development computer, but my colleagues ran into errors loading the page. The error I'm getting in the console at the moment is:
mighty-savannah-97969.herokuapp.com/:24 GET https://unpkg.com/react-dom@15.4.2/dist/react-dom.min.js
Playing with URLs at unpkg, I see that 15.4.1 and 15.5.1 exist.

@jimaek
Copy link

jimaek commented Aug 16, 2017

You can use jsDelivr instead https://cdn.jsdelivr.net/npm/react-dom@15.4.2/dist/react-dom.min.js

It's more reliable and built to be production ready, without such problems.

@radumas
Copy link
Author

radumas commented Aug 16, 2017

Indeed the problem appears to be with unpkg. Now bundle.js is struggling to be delivered.

How do I change the javascript sources in Dash?

This happens due to plotly/dash-renderer#11

@ned2
Copy link
Contributor

ned2 commented Aug 16, 2017

The react javascript files are included within the dash-renderer package rather than dash itself. I've submitted this PR plotly/dash-renderer#12 to update the react files to 15.6.1.

If you look at the changes you'll see how to point to the javascript file you want.

@chriddyp
Copy link
Member

For now, you can render the files locally without relying on the CDN with

app.css.config.serve_locally = True
app.scripts.config.serve_locally = True

@ned2
Copy link
Contributor

ned2 commented Aug 16, 2017

Ah, so now I see what is meant by local CSS/JS is not supported. I've just been adding them with eg app.css.append_css({"external_url": '/static/css/foo.css'}) which has been working fine, however setting app.css.config.serve_locally = True now means that Dash can't find the file. As I get this UserWarning:

A local version of /static/css/foo.css is not available

Strangely it's finding local javascript files fine. Perhaps this wants to be a separate issue...

@radumas
Copy link
Author

radumas commented Aug 16, 2017

Can confirm that

app.css.config.serve_locally = True
app.scripts.config.serve_locally = True

works on heroku as well.

Thanks @chriddyp !

@chriddyp
Copy link
Member

FYI - The original issue (failures serving react-dom from unpkg cdn) is being tracked here: unpkg/unpkg#54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants