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

15th
Feb 2016
Armin Keyvanloo
@arminio
Feb 15 2016 05:40
trying to get a hello world working and getting : Uncaught TypeError: Cannot read property 'SvgIcons' of undefined. Where have I gone wrong?
same thing happens when I changed the component from a Muibutton to an avatar :
val HelloMessage = ReactComponentB[String]("HelloMessage") .render { $ => <.div( MuiAvatar()("one") ) } .build
Uncaught TypeError: Cannot read property 'Avatar' of undefined
Chandra Sekhar Kode
@chandu0101
Feb 15 2016 05:43
looks like mui not defined
Armin Keyvanloo
@arminio
Feb 15 2016 06:12
I have the mui defined exactly the same but I may be serving my page incorrectly. Do I need to serve and access my page via webpack to effectively get the defined mui?
Chandra Sekhar Kode
@chandu0101
Feb 15 2016 06:15
nah webpack is not mandatory. can you post u r index.html here ..
Armin Keyvanloo
@arminio
Feb 15 2016 06:15
actually, it looks like mui loading errors first:
Uncaught ReferenceError: require is not defined
components-spike-fastopt.js:9722
Loaded bundles/material-ui.js
my index.html
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Components Spike By Armin</title>
</head>
<body>
<!-- Include Scala.js compiled code -->
<script type="text/javascript" src="./target/scala-2.11/components-spike-jsdeps.js"></script>
<script type="text/javascript" src="./target/scala-2.11/components-spike-fastopt.js"></script>
<!-- Run tutorial.webapp.TutorialApp -->
<div id="pageContents"></div>
<!--<button id="click-me-button" type="button" onclick="myob.banking.migration.MigrationApp().addClickedMessage()">Click me!</button>-->
<script type="text/javascript">
    demo.ComponentApp().main();
</script>
</body>
The root cause seems to be this:
Uncaught ReferenceError: webpackJsonp is not defined(anonymous function) @ material_ui-bundle.js:1
helpers.scala:35 Loaded assets/material_ui-bundle.js
Øyvind Raddum Berg
@oyvindberg
Feb 15 2016 08:43
"Uncaught ReferenceError: require is not defined" <-- what gave you that error? a browser?
Armin Keyvanloo
@arminio
Feb 15 2016 09:02
Yes
Chandra Sekhar Kode
@chandu0101
Feb 15 2016 13:12
@arminio sorry can’t tell more unless i see u r web pack config. btw where is material-ui script tag in index.html ?
https://github.com/chandu0101/scalajs-react-template-webpack , its old one but i think it will give an idea ..
Øyvind Raddum Berg
@oyvindberg
Feb 15 2016 16:29
might you be serving the "bundle" js, which is meant to be run by webpack, to the browser?
Alexej Haak
@Daxten
Feb 15 2016 16:37
@elacin do you think you could do a hotfix release in the next few days? For the MuiIconButton has no onClick/onTap issue?
I would create a PR but I think the mui stuff gets generated automaticly right?
Øyvind Raddum Berg
@oyvindberg
Feb 15 2016 16:40
well yeah in fact it's fixed in master
Alexej Haak
@Daxten
Feb 15 2016 16:40
we don't have a maven server and I work with 1 other person on this project :(
do you think you will make a new release soon?
Øyvind Raddum Berg
@oyvindberg
Feb 15 2016 16:40
chandu0101/scalajs-react-components@af78a10
im sure we could do that
in the mean time you can always copy/paste the wrapper you need and check it out
Alexej Haak
@Daxten
Feb 15 2016 16:42
ah true, will do that!
Alexej Haak
@Daxten
Feb 15 2016 16:50
type mismatch;
 found   : scala.scalajs.js.|[String,japgolly.scalajs.react.ReactElement]
 required: scala.scalajs.js.Any
@     val props = JSMacro[MuiIconButton](this)
:(
when copying it out and adding
import chandu0101.scalajs.react.components._
import chandu0101.scalajs.react.components.materialui._
Alexej Haak
@Daxten
Feb 15 2016 16:57
ah found a perfect workaround
don't mind me :)
Øyvind Raddum Berg
@oyvindberg
Feb 15 2016 17:00
ah yeah, need to solve that Union problem someday