Closed AaronNGray closed 7 years ago
Hi Aaron,
Thanks for testing my code examples! :+1:
The error seems to be rooted in TypeScript compiler's rejection of non-TS-modules (like raw javascript files, for example).
Here you can find more info regarding this problem: https://github.com/Microsoft/TypeScript/issues/2302
The newer version of TS accepts non-TS-files via the --allowJS switch: https://github.com/Microsoft/TypeScript/wiki/What%27s-new-in-TypeScript#including-js-files-with---allowjs
Regards,
On Debian I am getting the same
then the following error in Firefox :-
Error: (SystemJS) patchProperty/desc.set/wrapFn@http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:795:27
Zone</ZoneDelegate</ZoneDelegate.prototype.invokeTask@http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:382:24
Zone</Zone</Zone.prototype.runTask@http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:282:29
ZoneTask/this.invoke@http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:449:29
Error loading http://localhost:3000/app/main.js
There should be more details regarding the last error with "main.js". "Error loading http://localhost:3000/app/main.js" could be many things in HTTP: 404 error, error 500 etc.
The following installs the nightly build of typescript :-
sudo npm install -g typescript@next
and similar in package.json
"tyepscript": "next"
Then added :-
"allowJs": true
to tsconfig.json
And tied modifying Gulpfile.ts :-
var typescript = require("typescript");
var tslint = require("tslint");
But that did not seem to help either !
no thurther details on app/main.js not loading.
Well, I have no other ideas than to ask you to upgrade your current Angular2 version. At this time the Betas were still around but my later articles jumped to RC. Of course, this is not a proper "solution" to the problems you have but playing around with a Beta while there are RC's available isn't something I'd recommend either.
https://github.com/angular/angular/issues/7818
Also, take into account that in my later articles I've switched from SystemJS/Gulp to Webpack (I'm using the excellent Webpack-Starter from AngularClass)
Angular2-datatable examples have the same bug. I cannot work out how to solve that one either !
Are you using the RC version or still the beta from the article? I suppose the problem is rooted there. I'd just copy the important parts of the logic which are not bound to a particular version anyway.
rc-17 IIRC Have tried both on Windows and Linux
I don't think it depends on the OS. But sadly I'm not able to give you any further advice. It could be many things: your current node version, or some globally available packages that prevent local ones from executing. Or some issue with the build configs.
okay I will try when I come back to it
could you give me your Node.js and NPM versions please ?
On 26 July 2016 at 00:09, Harris Brakmic notifications@github.com wrote:
I don't think it depends on the OS. But sadly I'm not able to give you any further advice. It could be many things: your current node version, or some globally available packages that prevent local ones from executing. Or some issue with the build configs.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/brakmic/Angular2-Articles/issues/1#issuecomment-235113969, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFOEyncYy1GYYmgb88oYgz703tWYWuOks5qZUIggaJpZM4JPnOY .
node: 6.3.1 npm: 3.5.3
C:\Users\Aaron Gray>Node --version v6.3.0
C:\Users\Aaron Gray>npm --version 3.10.3
On 26 July 2016 at 00:41, Harris Brakmic notifications@github.com wrote:
node: 6.3.1 npm: 3.5.3
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/brakmic/Angular2-Articles/issues/1#issuecomment-235119728, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFOE3j4kS1inQs7CVHLAs3fRZ4d0bUOks5qZUmrgaJpZM4JPnOY .
on doing an
npm install
npm start
I get the following and the app is not loading in the browser, just a 'Loading ...' and a spinner
runtime is giving :-