angular / angular-cli

CLI tool for Angular
https://cli.angular.io
MIT License
26.76k stars 11.97k forks source link

rc6 update #1938

Closed nkmdev closed 8 years ago

nkmdev commented 8 years ago

Hi guys, when we can get rc6 generated project currently it generate rc4 which is quite old.

neilhem commented 8 years ago

RC.6 has been released just a day ago, so next release of angular-cli after that will support RC.6. BTW update to the latest version 1.0.0-beta.11-webpack.8 which supports RC.5

nkmdev commented 8 years ago

but rc6 is out there but it generate rc4

kylecordes commented 8 years ago

rc.6 arrived less than 24 hours ago... the CLI team works fast but they must occasionally eat and sleep. :-)

sprypradeep commented 8 years ago

system-config.js in quickstart is changed completely for barrels, so the app breaks if we use angular-cli, even if there is no new release asap, a fix should be posted.

ng2 barrels have been changed and do not work with cli barrels.

zone.js:101 GET http://localhost:4200/traceur 404 (Not Found)scheduleTask @ zone.js:101ZoneDelegate.scheduleTask @ zone.js:345Zone.scheduleMacroTask @ zone.js:282(anonymous function) @ zone.js:122send @ VM1558:3fetchTextFromURL @ system.src.js:1156(anonymous function) @ system.src.js:1739ZoneAwarePromise @ zone.js:607(anonymous function) @ system.src.js:1738(anonymous function) @ system.src.js:2764(anonymous function) @ system.src.js:3338(anonymous function) @ system.src.js:3605(anonymous function) @ system.src.js:3990(anonymous function) @ system.src.js:4453(anonymous function) @ system.src.js:4705(anonymous function) @ system.src.js:408ZoneDelegate.invoke @ zone.js:332Zone.run @ zone.js:225(anonymous function) @ zone.js:591ZoneDelegate.invokeTask @ zone.js:365Zone.runTask @ zone.js:265drainMicroTaskQueue @ zone.js:497ZoneTask.invoke @ zone.js:437
zone.js:484 Unhandled Promise rejection: Error: XHR error (404 Not Found) loading http://localhost:4200/traceur
        at XMLHttpRequest.wrapFn [as _onreadystatechange] (http://localhost:4200/vendor/zone.js/dist/zone.js:794:30)
        at ZoneDelegate.invokeTask (http://localhost:4200/vendor/zone.js/dist/zone.js:365:38)
        at Zone.runTask (http://localhost:4200/vendor/zone.js/dist/zone.js:265:48)
        at XMLHttpRequest.ZoneTask.invoke (http://localhost:4200/vendor/zone.js/dist/zone.js:433:34)
    Error loading http://localhost:4200/traceur
    Error loading http://localhost:4200/vendor/@angular/platform-browser-dynamic/index.js as "@angular/platform-browser-dynamic" from http://localhost:4200/main.js ; Zone: <root> ; Task: Promise.then ; Value: Error: 
Error: XHR error (404 Not Found) loading http://localhost:4200/traceur(…) nullconsoleError @ zone.js:484_loop_1 @ zone.js:511drainMicroTaskQueue @ zone.js:515ZoneTask.invoke @ zone.js:437
zone.js:486 Error: Uncaught (in promise): Error: Error: XHR error (404 Not Found) loading http://localhost:4200/traceur(…)consoleError @ zone.js:486_loop_1 @ zone.js:511drainMicroTaskQueue @ zone.js:515ZoneTask.invoke @ zone.js:437
263system.src.js:373 Assertion failed: loading or loaded
jrauschenbusch commented 8 years ago

Same issue here. A first investigation of the problem results in that several *.js files in /dist/vendor/@angular contains ES6 syntax. Hence SystemJS tries to load traceur to be able to transpile it.

JSMike commented 8 years ago

FYI: There's already a PR for this. I'm sure it will take the team some time to update everything and get tests passing again. Until then you should be using the RC that matches the version of angular-cli for your project.

ipoj commented 8 years ago

actually, i'm waiting for -mobile comeback. sorry for off topic.

jwuliger commented 8 years ago

I thought the Angular team were really robots powered by Google AI. No need to eat or sleep!! :smile: :laughing: :laughing: :stuck_out_tongue_closed_eyes:

moparlakci commented 8 years ago

let them eat and sleep 👍

oswaldofreitas commented 8 years ago

Why eat and sleep every day? Suggestion: you could sleep today and eat tomorrow.

choucry13 commented 8 years ago

Hi all, i changed the system-config.ts like this :

***********************************************************************************************
 * User Configuration.
 **********************************************************************************************/
/** Map relative paths to URLs. */
const map: any = {};

/** User packages configuration. */
const packages: any = {
    'rxjs'                             : {main: 'Rx'},
        '@angular/core'                    : {main: 'bundles/core.umd.min.js'},
        '@angular/common'                  : {main: 'bundles/common.umd.min.js'},
        '@angular/compiler'                : {main: 'bundles/compiler.umd.min.js'},
        '@angular/platform-browser'        : {main: 'bundles/platform-browser.umd.min.js'},
        '@angular/platform-browser-dynamic': {main: 'bundles/platform-browser-dynamic.umd.min.js'},
        '@angular/http' : {main: 'bundles/http.umd.min.js'}
};

////////////////////////////////////////////////////////////////////////////////////////////////
/***********************************************************************************************
 * Everything underneath this line is managed by the CLI.
 **********************************************************************************************/
const barrels: string[] = [

  // App specific barrels.
  /** @cli-barrel */
];

const cliSystemConfigPackages: any = {};
barrels.forEach((barrelName: string) => {
    cliSystemConfigPackages[barrelName] = {main: 'index'};
});

/** Type declaration for ambient System. */
declare var System: any;

// Apply the CLI SystemJS configuration.
System.config({
  map: {'@angular': 'vendor/@angular', 'rxjs': 'vendor/rxjs', 'main': 'main.js'},
  packages: cliSystemConfigPackages
});
//
// Apply the user's configuration.
System.config({map, packages});

I give you my package configuration too :

"dependencies": {
    "@angular/common": "2.0.0-rc.6",
    "@angular/compiler": "2.0.0-rc.6",
    "@angular/core": "2.0.0-rc.6",
    "@angular/http": "2.0.0-rc.6",
    "@angular/platform-browser": "2.0.0-rc.6",
    "@angular/platform-browser-dynamic": "2.0.0-rc.6",
    "@angular/router": "3.0.0-rc.2",
    "es6-shim": "0.35.1",
    "reflect-metadata": "0.1.3",
    "rxjs": "5.0.0-beta.11",
    "systemjs": "0.19.26",
    "zone.js": "0.6.17"
  },
  "devDependencies": {
    "angular-cli": "1.0.0-beta.10",
    "codelyzer": "0.0.19",
    "ember-cli-inject-live-reload": "1.4.0",
    "protractor": "3.3.0",
    "ts-node": "1.2.1",
    "tslint": "3.13.0",
    "typescript": "2.0.0"
  }
Juliete commented 8 years ago

I was able to build with angular cli after upgrade to rc6 by adding 'typescript/*/.+(js|js.map)' to the vendorNpmFiles array in the angular-cli-build.js.

And changing sytem.config.ts to: "use strict";

// SystemJS configuration file, see links for more information // https://github.com/systemjs/systemjs // https://github.com/systemjs/systemjs/blob/master/docs/config-api.md

/***

/* User packages configuration. / const packages: any = { };

packages['ng2-pagination'] = { format: 'cjs', defaultExtension: 'js', main: 'index', };

//////////////////////////////////////////////////////////////////////////////////////////////// /***

const cliSystemConfigPackages: any = { 'vendor/ng2-bootstrap': { defaultExtension: 'js',
} }; barrels.forEach((barrelName: string) => { cliSystemConfigPackages[barrelName] = { main: 'index.js' }; //add extension });

/* Type declaration for ambient System. / declare var System: any;

// Apply the CLI SystemJS configuration. System.config({ transpiler: 'typescript', //add transpiler map: { '@angular': 'vendor/@angular', 'rxjs': 'vendor/rxjs', 'main': 'main.js', 'angular2-moment': 'vendor/angular2-moment', 'ng2-bootstrap': 'vendor/ng2-bootstrap', 'ng2-pagination': 'vendor/ng2-pagination', 'typescript': 'vendor/typescript/lib/typescript.js' //add typescript map }, packages: cliSystemConfigPackages });

// Apply the user's configuration. System.config({ map, packages });

khanujasunny commented 8 years ago

Hi Guys, Any update on this?

ghost commented 8 years ago

And, maybe a dumb question, but can we use AOT with Angular CLI?

khanujasunny commented 8 years ago

@rolandoldengarm : Why you think its a dumb question ?

ghost commented 8 years ago

@khanujasunny maybe I missed something, but I don't think it's a feature of Angular CLI.

khanujasunny commented 8 years ago

@rolandoldengarm : Which feature ?

ghost commented 8 years ago

Ah, there's already an issue for that: https://github.com/angular/angular-cli/issues/1732

khanujasunny commented 8 years ago

it seems that question is not for AoT compilation but for rc6 update in angular-cli ;)

karthikkavin commented 8 years ago

Angular cli update on RC6?

BenoitFroment commented 8 years ago

Any process to manually update from angular-cli rc4 to rc6 ?

vinagreti commented 8 years ago

I think you have to wait for RC6 support to be released. But you can get one step forward and transform all your components into modules that is the new way of organizing your app features in RC6. So, when ng-cli rc6 support become available you are ready to use it!

BenoitFroment commented 8 years ago

My way to go (considering : https://angular.io/docs/ts/latest/cookbook/rc4-to-rc5.html) : -Update package.json by rc4 to rc6 and TypeScript 1.8 to 2.0.0 -Create app.module.ts and update main.ts following : https://github.com/StephenFluin/ngmodule-migration/commit/9f9c6ae099346e491fc31d77bf65ed440e1f164c -Run : npm install @angular/{core,common,compiler,platform-browser,platform-browser-d ynamic} --save -Run : npm install angular-cli @angular/tsc-wrapped --save-dev


Got this build error :

Error: Typescript found the following errors: /tmp/broccoli_type_script_compiler-input_base_path-0wzn2lif.tmp/0/src/app/app.component.spec.ts (3, 10): Module '"/node_modules/@angular/core/testing/index"'has no exported member 'addProviders'.

vinagreti commented 8 years ago

@Aorewen this is only the first error.. I've been there before... hehehe... When you fix this error removing addProviders from the test file you will end up in another error that is "cannot find traceur" and when you fiz it, you will end up in another one and so on. Trust me, wait for the Angular cli RC6 support to be released is better then trying to update it by yourself.

BenoitFroment commented 8 years ago

Thanks, at least i'm not feeling alone. :)

dekonunes commented 8 years ago

I'll be necessary build a new app using Angular-cli RC6 and move the src to the new app? or i can update using comand to this? my error is "traceur.js 404", when updated RC6 from RC5

ihachani commented 8 years ago

Using webpack after upgrade the rc6 I was able to run ng serve. But when I use ng test I get this error Uncaught Error: Missing: SyncTestZoneSpec . Looking the error up someone suggested adding this to the karma shim require('zone.js/dist/proxy'); https://github.com/angular/zone.js/issues/404 But there is no such file in the webpack cli project.

moparlakci commented 8 years ago

just clone the git repo and do npm link as decribed in the readme and you will get rc6 (latest) up and running

some1awesome commented 8 years ago

@ihachani Did you ever fix your problem? I'm getting the same issue.

dekonunes commented 8 years ago

@zackporter92 have 2 ways to solve this, depends of the way you are using angular, if you are using Angular-Cli:

Look the comment of @choucry13 upside.

If you are using systemjs.config.js of angular quickstart you need clone the new repo.

some1awesome commented 8 years ago

@dekonunes I'm using the webpack version and so I don't have a systemjs config file

jwuliger commented 8 years ago

Hey guys, I found that doing what @moparlakci suggested with NPM Link fixed all my problems. If you are using the webpack version.

slyerrr commented 8 years ago

OK so today i used this from the git : Global package:

npm uninstall -g angular-cli npm cache clean npm install -g angular-cli@latest Local project package:

rm -rf node_modules dist tmp npm install --save-dev angular-cli@latest ng init

And it installed angular cli with the angular rc4, what's the problem ? you have allready in the repo in package.json angular rc6 so why ?

meriturva commented 8 years ago

@slyerrr you are right! same here!

kucharzyk commented 8 years ago

Forget about rc6...

rc7 was published today

vinagreti commented 8 years ago

Should we expect that the AngularCli Team follow every RC or is better to wait the final release to start using it? I'm still using RC5 because RC6 support was not released... My point is if it worth to work in every RC since it is changing so fast and the AngularCli Team cannot follow its speed.

radoslavpetranov commented 8 years ago

I was relieved to see there were practically no breaking changes in RC7!

srivasrk commented 8 years ago

RC7 change log looks pretty compact. Nothing major, and practically no breaking changes. I would not worry too much about RC7. Angular CLI however! idk.

kucharzyk commented 8 years ago

I'm also still using rc5 and waiting for next beta release.

In my opinion AngularCli team should try to follow each rc. If ye are using cli we will skip rc6 but after next release there we may report lots of issues introduced in both rc6 and rc7. More frequent releases could avoid it and help eliminate some bugs. Cli could be better tested then.

BenoitFroment commented 8 years ago

I found a way to start a new project using angular-cli with rc7:

-create a directory and go in -run npm install angular-cli@webpack -run ng new PROJECT_NAME -run cd PROJECT_NAME -open package.json : u're in rc5 -update package.json with these deps :

"dependencies": {
    "@angular/common": "2.0.0-rc.7",
    "@angular/compiler": "2.0.0-rc.7",
    "@angular/core": "2.0.0-rc.7",
    "@angular/forms": "2.0.0-rc.7",
    "@angular/http": "2.0.0-rc.7",
    "@angular/platform-browser": "2.0.0-rc.7",
    "@angular/platform-browser-dynamic": "2.0.0-rc.7",
    "@angular/router": "3.0.0-rc.3",
    "core-js": "^2.4.0",
    "rxjs": "5.0.0-beta.12",
    "ts-helpers": "^1.1.1",
    "zone.js": "0.6.21"
  },
  "devDependencies": {
    "@types/jasmine": "^2.2.30",
    "angular-cli": "1.0.0-beta.11-webpack.8",
    "codelyzer": "~0.0.26",
    "jasmine-core": "2.4.1",
    "jasmine-spec-reporter": "2.5.0",
    "karma": "0.13.22",
    "karma-chrome-launcher": "0.2.3",
    "karma-jasmine": "0.3.8",
    "karma-remap-istanbul": "^0.2.1",
    "protractor": "4.0.3",
    "ts-node": "1.2.1",
    "tslint": "3.13.0",
    "typescript": "^2.0.0"
  }

-update tsconfig.json : "module": "commonjs", -run npm install -run ng serve

app works!

thanks @serhiisol for is help

jwuliger commented 8 years ago

Nice trick! If you are using NPM Link with the Master branch of the CLI. It looks like the team just updated it to RC7. Woot!

radoslavpetranov commented 8 years ago

Just a heads up for anyone subscribed to this thread - webpack.9 is up! Thank you ng CLI team!

'1.0.0-beta.11-webpack.9': '2016-09-13T20:02:08.970Z'
jwuliger commented 8 years ago

Awesome! Thanks CLI Team!

radoslavpetranov commented 8 years ago

Erm, after I took a second look, what does "experimental" mean in this context?

 { beta: '1.0.0-beta.10',
   latest: '1.0.0-beta.10',
   webpack: '1.0.0-beta.11-webpack.8',
   experimental: '1.0.0-beta.11-webpack.9' },

Is webpack.9 a logical continuation of the BETA process that takes us a step closer to RC or are we in for surprises should we decide to upgrade to webpack.9?

jwuliger commented 8 years ago

Hmmmm.... Very good question indeed @radoslavpetranov

srivasrk commented 8 years ago

I am waiting for "All hell broke loose" messages. I would be happy if I am wrong this time.

jwuliger commented 8 years ago

I am getting ready to test it out now...will let you know! haha

radoslavpetranov commented 8 years ago

I upgraded as well - everything seems to work fine in both dev and prod mode. To those of you who wonder, here are the dependency versions as of webpack.9

 "dependencies": {
    "@angular/common": "2.0.0-rc.7",
    "@angular/compiler": "2.0.0-rc.7",
    "@angular/core": "2.0.0-rc.7",
    "@angular/forms": "2.0.0-rc.7",
    "@angular/http": "2.0.0-rc.7",
    "@angular/platform-browser": "2.0.0-rc.7",
    "@angular/platform-browser-dynamic": "2.0.0-rc.7",
    "@angular/router": "3.0.0-rc.3",
    "core-js": "^2.4.1",
    "rxjs": "5.0.0-beta.12",
    "ts-helpers": "^1.1.1",
    "zone.js": "^0.6.21"

and typescript is now

"typescript": "2.0.2"

And again, thanks CLI team!

ShadowManu commented 8 years ago

Reconfirming that our team has updated the cli on a medium-sized app with same deps as @radoslavpetranov, working fine under angular-cli@1.0.0-beta.11-webpack.9-4 on npm to be precise.

Thanks CLI team!

brendanalexdr commented 8 years ago

after installing angular-cli@1.0.0-beta.11-webpack.9-4 and running 'ng serve' i get the following error:

Cannot find module 'process-nextick-args'

running 'npm install process-nextick-args' fixes it.