You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Versions. Please run ng --version. If there's nothing outputted, please
angular-cli: 1.0.0-beta.5
node: 4.4.5
os: linux x64
Repro steps. Was this an app that wasn't created using the CLI? What change did you
do on your code?
created the app with CLI
no changes to the base code, build on top of the app
The log given by the failure. Normally this include a stack trace and some
more information.
when hosting on live website, I resolve this issue by copying the .directive.js file
directly to the dist folder and host it. but when running production locally, that doesnt work.
Thanks! We'll be in touch soon.
The text was updated successfully, but these errors were encountered:
There should be no link in index.html to to any JavaScript-Class then the standard ones, angular-cli creates. All external libraries / or directives need to be loaded via SystemJS for prod-mode to work. Here are some tips, maybe they help you:
This is not an external library, this was a custom directive I created with angular cli, and it was bootstrapped in main.ts. but it magically disappears when compiled in production mode.
ng --version
. If there's nothing outputted, pleaseangular-cli: 1.0.0-beta.5
node: 4.4.5
os: linux x64
do on your code?
created the app with CLI
no changes to the base code, build on top of the app
more information.
zone.js:101 GET http://localhost:4200/app/trackscroll.directive.js 404 (Not Found)scheduleTask @ zone.js:101ZoneDelegate.scheduleTask @ zone.js:336Zone.scheduleMacroTask @ zone.js:273(anonymous function) @ zone.js:122send @ VM2683:3fetchTextFromURL @ system.src.js:1154(anonymous function) @ system.src.js:1735ZoneAwarePromise @ zone.js:584(anonymous function) @ system.src.js:1734(anonymous function) @ system.src.js:2759(anonymous function) @ system.src.js:3333(anonymous function) @ system.src.js:3600(anonymous function) @ system.src.js:3985(anonymous function) @ system.src.js:4448(anonymous function) @ system.src.js:4700(anonymous function) @ system.src.js:406ZoneDelegate.invoke @ zone.js:323Zone.run @ zone.js:216(anonymous function) @ zone.js:571ZoneDelegate.invokeTask @ zone.js:356Zone.runTask @ zone.js:256drainMicroTaskQueue @ zone.js:474ZoneTask.invoke @ zone.js:426
zone.js:461 Unhandled Promise rejection: Error: XHR error (404 Not Found) loading http://localhost:4200/app/trackscroll.directive.js
at XMLHttpRequest.wrapFn as _onreadystatechange
at ZoneDelegate.invokeTask (http://localhost:4200/vendor/zone.js/dist/zone.js:356:38)
at Zone.runTask (http://localhost:4200/vendor/zone.js/dist/zone.js:256:48)
at XMLHttpRequest.ZoneTask.invoke (http://localhost:4200/vendor/zone.js/dist/zone.js:423:34)
Error loading http://localhost:4200/app/trackscroll.directive.js as "./app/trackscroll.directive" from http://localhost:4200/main.js ; Zone: ; Task: Promise.then ; Value: Error: Error: XHR error (404 Not Found) loading http://localhost:4200/app/trackscroll.directive.js(…)consoleError @ zone.js:461_loop_1 @ zone.js:490drainMicroTaskQueue @ zone.js:494ZoneTask.invoke @ zone.js:426
zone.js:463 Error: Uncaught (in promise): Error: Error: XHR error (404 Not Found) loading http://localhost:4200/app/trackscroll.directive.js(…)
when hosting on live website, I resolve this issue by copying the .directive.js file
directly to the dist folder and host it. but when running production locally, that doesnt work.
The text was updated successfully, but these errors were encountered: