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

Both auto refresh and manual refresh not working

Open DesDiv opened this issue 8 years ago • 2 comments

Running the project with sbt ~fastOptJS and going to http://localhost:12345/index.html works perfectly fine.

But refreshing the page doesn't work, since I'm immediately redirected to http://localhost:12345/scalajs-react-template/, which doesn't exist, so each refresh fails with the error message The requested resource could not be found.. I tried on both the latest Firefox and Chrome and the behavior is the same. Since refreshing doesn't work, my current workaround is manually opening http://localhost:12345/index.html after every code change.

I'm not sure whether this template supports hot reload (auto refresh upon code change) or not, but if it does then it's not working for me either. After every code change ~fastOptJS runs and successfully produces an updated js/scalajs-react-template-opt.js file. But nothing occurs on the browser end.

DesDiv avatar Jun 11 '17 22:06 DesDiv

Changing line 47 of AppRouter.scala to val baseUrl = BaseUrl.fromWindowOrigin / "index.html" fixed the manual refresh problem for me.

Hot reload still doesn't work though.

DesDiv avatar Jun 12 '17 16:06 DesDiv

@DesDiv you need to add this line <script type="text/javascript" src="./workbench.js"></script> to the index.html file as documented on the workbench plugin page HTH

Angel-O avatar Jan 20 '19 22:01 Angel-O