These are chat archives for chandu0101/scalajs-react-components

1st
Jul 2016
Øyvind Raddum Berg
@oyvindberg
Jul 01 2016 09:18
hah, thats weird, i would normally say that seems like a bug in mui itself
still have hopes to push out support for 0.15 this weekend
lets hope that can fix it :)
Raul Rodriguez
@raul782
Jul 01 2016 09:29
:+1: In the meantime, I was suspecting that maybe a dependency was being loaded twice, since I’ve been using jsDependencies for React and webpack is generating material-ui. It looked that way, so I’ve dropped jsDependencies and went with only webpack, however, I’m getting the same error. https://gist.github.com/raul782/1ac6f3fb371db3ebe27524b3c753cf0a
In the past, I remember, the issue was not calling the right asset with WithAsyncScript, but now that bundle.js contains react +add-ons and material-ui. Shouldn’t it work?
Øyvind Raddum Berg
@oyvindberg
Jul 01 2016 09:38
yeah in that case its probable that you had react loaded twice
better to delegate all the javascript bundling to webpack for now, as you did
how about this callemall/material-ui#2818 ?
seems npm, if two versions of react are required, will helpfully provide both?
Raul Rodriguez
@raul782
Jul 01 2016 09:42
npm ls | grep react
├─┬ react@0.14.7
├── react-addons-create-fragment@0.14.7
├── react-addons-css-transition-group@0.14.7
├── react-addons-pure-render-mixin@0.14.7
├── react-addons-transition-group@0.14.7
├── react-addons-update@0.14.7
├── react-dom@0.14.7
├─┬ react-hot-loader@1.3.0
│ ├── react-hot-api@0.4.7
├─┬ react-tap-event-plugin@0.2.2
This is my graph for react
Øyvind Raddum Berg
@oyvindberg
Jul 01 2016 09:43
hmm, perhaps not that then
you can still manually inspect the generated bundle files
it should be easy to tell if the one for materialui also contains the whole of react
Raul Rodriguez
@raul782
Jul 01 2016 09:47
I need to generate the bundle uncompressed.
I’ll try that and see if it’s being required twice, right?
Raul Rodriguez
@raul782
Jul 01 2016 09:58
So I guess, if I only found one match of window.React and window.ReactDOM that means, they’re not duplicated right?
Øyvind Raddum Berg
@oyvindberg
Jul 01 2016 10:07
you can just search for a string from react implementation for example
"Using Maps as children is not yet fully supported. It is an experimental feature that might be removed"
or whatever else
if you have that, you have the implementation in that file
Raul Rodriguez
@raul782
Jul 01 2016 10:08
ok so my bundle.js has only one match for that text.
Øyvind Raddum Berg
@oyvindberg
Jul 01 2016 10:09
and you mui bundle doesnt have it? in that case that is not the problem
Raul Rodriguez
@raul782
Jul 01 2016 10:09
And this file contains all my deps.
Øyvind Raddum Berg
@oyvindberg
Jul 01 2016 10:09
ah ok
Raul Rodriguez
@raul782
Jul 01 2016 10:22
:worried: I’ll try deleting node_modules folder, see if that works.
Raul Rodriguez
@raul782
Jul 01 2016 10:39
nope, it didn’t I know, the error is located in helpers.scala line 35, inside WithAsyncScript, after console.log call,
if (scripts.contains(script))
            Some(s)
          else {
            script.onload = (e: Event) => {
              console.log(s"Loaded $s")
              $.setState(alreadyLoaded + s).runNow()
            }
            body.appendChild(script)
            None
          }
Øyvind Raddum Berg
@oyvindberg
Jul 01 2016 10:47
if you have all the javascript in a single bundle, i dont suppose you should use that component?
Øyvind Raddum Berg
@oyvindberg
Jul 01 2016 10:52
it would at least explain that you have two instances of react loaded :)
Raul Rodriguez
@raul782
Jul 01 2016 11:02
:smile: I understand now, that helper was meant to be used in the demo since you had different libraries.
bummer :/
Øyvind Raddum Berg
@oyvindberg
Jul 01 2016 11:06
but if you just take it out, you should be good
Raul Rodriguez
@raul782
Jul 01 2016 16:41
thanks, that fixed the issue :smile: