play-angular-typescript.g8
play-angular-typescript.g8 copied to clipboard
template3 (single js out file) doesn't work with ng2
Hi, great activator!
However when doing sbt dist for production and then launching the binary file it fails with
http://localhost:9000/assets/lib/rxjs/rx.js Failed to load resource: the server responded with a status of 404 (Not Found) zone.min.js:1 Error: (SystemJS) Error: XHR error (404 Not Found) loading http://localhost:9000/assets/lib/rxjs/rx.js(…)e.invoke @ zone.min.js:1
I couldn't replicate your issue. I called sbt stage
and then ran the binary and the NG2 application starts just fine.
Since I couldn't replicate the issue and haven't heard from your for quite a while I'm closing the issue.
I know you have closed the issue, but I am having the same problem if I follow your readme.
Running:
sbt stage
it works, however, JS is served as more than one file.
Running:
sbt stage -tsCompileMode=stage
it gets the same error as @golechwierowicz :
zone.min.js:1 Error: (SystemJS) XHR error (404 Not Found) loading http://localhost:9000/assets/app/main.js(…)
e.invoke @ zone.min.js:1
n.run @ zone.min.js:1
(anonymous function) @ zone.min.js:1
e.invokeTask @ zone.min.js:1
n.runTask @ zone.min.js:1
a @ zone.min.js:1
invoke @ zone.min.js:1
The template3 variant hasn't been ported to ng2 final yet. It's mostly an ng2 matter with a little bit of knowledge of Play required.
What needs to be done is that the <script/>
downloads and the SystemJs config need to be updated for Angular2. What's different in the SystemJs config is that either the config shouldn't do anything about loading the app code and we should load it using a script tag. Or we should configure SystemJs to go to this single file for all app modules.
I'm pretty busy the coming weeks. A pull request is welcome.
I have tried to run the single javascript file compilation. The only problem I have is that in the generated main.js
there are a lot of references to Angular2
dependencies. For example, there is a line that is:
System.register("app/app/app.component", ['@angular/core'], function //...
All those files are being requested by the browser and they are not shipped with that main.js
, they still cannot be accessed because there is nothing on localhost:9000/@angular/core
.
The only javascript files referenced in this index2.html
are
-
angular2-polyfills.js
-
system.js
-
Rx.js
-
angular2.dev.js
-
main.js
None of them having problems loading.
I run using activator -DtsCompileMode=stage ~run
I know this template is not ported yet for this template, and I'm really sorry for bothering you with this 😓 , I just don't really know what is the missing part on this. Are dependencies not being compiled inside main.js
?
I attach my main.js
, I have changed the HTML System
import script for:
<script>
System.import('app/main')
.catch(console.error.bind(console));
</script>
I don't really have any urges with this, so don't worry.
Thank you! 😃
@joost-de-vries any updates here? I know you said you are busy, but just wanted to know if you will be looking at this anytime soon? I too am unable to get the index2 to work. I am getting 404 of angular2-polyfills.js, angualr2.dev.js files
Thanks
Hi, Some updates about single js file compilation ? I'm struggling too running my app in production. Thanks