Skip to content
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

how to run this template? #2

Open
extirpate opened this issue Nov 5, 2015 · 8 comments
Open

how to run this template? #2

extirpate opened this issue Nov 5, 2015 · 8 comments

Comments

@extirpate
Copy link

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
Copy link
Author

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
Copy link
Author

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

@chandu0101
Copy link
Owner

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

@extirpate
Copy link
Author

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.

@chandu0101
Copy link
Owner

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

@mjvanleeuwen
Copy link

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.

@extirpate
Copy link
Author

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

refreshBrowsers <<= refreshBrowsers.triggeredBy(fastOptJS in Compile)

@christobill
Copy link
Contributor

christobill commented Mar 17, 2017

@extirpate I made a pull request using workbench based on what you were saying: #7

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