Getting Material UI from CDN #309
-
HI, I was wondering whether it is possible to grab the JS components from CDN rather than a local install. Going with the docs and the material UI example I thought I might be able to use Whilst this does not cause any errors on the python side of things, I do get a JS error in the browser Am i missing something obvious here? Apologies in advance for any naivety. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I'm not a JS wizard though, so I could be wrong about this, but I'm pretty sure this is because Material UI is using bare imports. If you check out some of the code from the CDN you'll find the following snippet: require("react") The problem here is that RequireJS is going to look for React at Thankfully there looks to be a solution to this problem of bare imports on the horizon in the form of Import Maps. Until then though, you'll need need to install it locally. Be sure to post here again if you have installation problems. |
Beta Was this translation helpful? Give feedback.
I'm not a JS wizard though, so I could be wrong about this, but I'm pretty sure this is because Material UI is using bare imports. If you check out some of the code from the CDN you'll find the following snippet:
The problem here is that RequireJS is going to look for React at
./react
when IDOM is actually hosting it at./react.js
.Thankfully there looks to be a solution to this problem of bare imports on the horizon in the form of Import Maps.
Until then though, you'll need need to install it locally. Be sure to post here again if you have installation problems.