scalajs-react-template icon indicating copy to clipboard operation
scalajs-react-template copied to clipboard

how to run this template?

Open extirpate opened this issue 9 years ago • 8 comments

i tried sbt container:start Or run or runMain or jetty:start

none of them works.

sbt run show me these errors

run [info] Running scalajsreact.template.ReactApp org.mozilla.javascript.EcmaError: TypeError: Cannot set property "React" of undefined to "[object Object]" (/Users/zn/.ivy2/cache/org.webjars/react/jars/react-0.12.1.jar#META-INF/resources/webjars/react/0.12.1/react-with-addons.js#4)

extirpate avatar Nov 05 '15 16:11 extirpate

exec python -m SimpleHTTPServer 4000

i found this file "serve.sh" in another place, it works!

i am wondering is this just for test or learn, not a robust http server ? if i want to scale this template in a production server, can you give some suggestion?

extirpate avatar Nov 05 '15 16:11 extirpate

my real purpose is to use scalajs-react with lift-web, still i can't find the right way

extirpate avatar Nov 05 '15 16:11 extirpate

there is no inbuilt server for this project , you must bring your own. Sorry i don't have any experience with lift-web

chandu0101 avatar Nov 05 '15 22:11 chandu0101

can i just precompile scalajs-react into something under webapp, and not use the router things which renders the components directly.If all in the webapp, then i can use other framework in the server side.Thank you very much!

发自我的 iPhone

在 2015年11月6日,06:14,Chandra Sekhar Kode [email protected] 写道:

there is no inbuilt server for this project , you must bring your own. Sorry i don't have any experience with lift-web

— Reply to this email directly or view it on GitHub.

extirpate avatar Nov 05 '15 23:11 extirpate

if you want to serve html directly from server then take a look at server side rendering of react , unfortunately i have no experience with server side stuff, may be you can ask here https://github.com/japgolly/scalajs-react

chandu0101 avatar Nov 06 '15 02:11 chandu0101

I used https://github.com/lihaoyi/workbench to run the template.

Add the following to plugins.sbt

addSbtPlugin("com.lihaoyi" % "workbench" % "0.2.3")

Add the following to build.sbt

import com.lihaoyi.workbench.Plugin._
workbenchSettings
bootSnippet := "ReactApp().main();"
updateBrowsers <<= updateBrowsers.triggeredBy(fastOptJS in Compile)

When you run sbt a local web server will also start. Go to http://localhost:12345/index.html and the app should appear.

mjvanleeuwen avatar Nov 11 '15 05:11 mjvanleeuwen

"The requested resource could not be found." when add the following to build.sbt

refreshBrowsers 

extirpate avatar Nov 21 '15 00:11 extirpate

@extirpate I made a pull request using workbench based on what you were saying: https://github.com/chandu0101/scalajs-react-template/pull/7

christobill avatar Mar 17 '17 15:03 christobill