angular-meteor icon indicating copy to clipboard operation
angular-meteor copied to clipboard

Unable to update Socially Tutorial to Angular4

Open cesargalindo opened this issue 9 years ago • 19 comments

The following Socially App Step19 https://github.com/cesargalindo/socially-step19-ang2.4.8 uses Angular 2.4.8 and Meteor 1.4.3.2 works fine.

I updated the app to Angular 4.0.1 by updating the npm modules in the package.json file. After performing an npm install I get the warnings listed below. Thinking these Meteor npm modules need to be updated?

WARNINGS

npm WARN [email protected] requires a peer of @angular/core@^2.0.0 but none was installed.
npm WARN [email protected] requires a peer of angular2-meteor-polyfills@^0.1.1 but none was installed.
npm WARN [email protected] requires a peer of @angular/core@^2.0.0 but none was installed.
npm WARN [email protected] requires a peer of @angular/common@^2.0.0 but none was installed.
  • According to angular2-google-map forums, Google Maps stills works. However it's not an issue related to Meteor.
npm WARN [email protected] requires a peer of @angular/common@^2.3.1 but none was installed.
npm WARN [email protected] requires a peer of @angular/core@^2.3.1 but none was installed.

When I attempt to run meteor I get the following errors in the console. There appears to be an issue with angular2-compilers? A copy of the Angular4 Meteor app can be found here https://github.com/cesargalindo/socially-step19-ang4.0.1 I haven't investigated it further than this:

meteor

ERRORS

Unable to resolve some modules:

  "@angular/animations" in /Users/cesargalindo/Downloads/SOCIALLY/socially-19b/node_modules/@angular/material/bundles/material.umd.js (web.browser)
                                              
If you notice problems related to these missing modules, consider running:
                                              
  meteor npm install --save @angular          
                                              
server/imports/publications/parties.ts (2, 24): Cannot find module 'meteor/tmeasday:publish-counts'.
=> Errors prevented startup:                  
   
   While processing files with angular2-compilers (for target web.browser):
   /client/main.scss: Scss compiler error: File to import: {}/node_modules/@angular/material/core/theming/all-theme not found in file:
   /Users/cesargalindo/Downloads/SOCIALLY/socially-19b/{}/client/main.scss
   
  
=> Your application has errors. Waiting for file change.

cesargalindo avatar Apr 11 '17 03:04 cesargalindo

Same issue here, it appears that angular2-meteor has a lock on 0.7.1. This causes not being able to update to angular 4 and also not being able to install ionic per tutorial since npm install ionic appears to be updated to ionic 3 which requires angular 4. Any plans to update the angular2-meteor package to align with angular 4?

asemoon avatar Apr 16 '17 02:04 asemoon

While making the changes it would be good to bump to the latest angular2-meteor-polyfills which is now at 0.2.0 (though there wasn't a huge change from 0.1.1).

sdarnell avatar Apr 16 '17 11:04 sdarnell

+1

rrubio avatar May 01 '17 03:05 rrubio

+1

msyahidin avatar May 02 '17 07:05 msyahidin

+1

aruntime avatar May 02 '17 07:05 aruntime

+1

katusiky avatar May 02 '17 17:05 katusiky

+1

Tytam avatar May 05 '17 10:05 Tytam

+1

rodrilink avatar May 06 '17 01:05 rodrilink

+1

rrubio avatar May 09 '17 22:05 rrubio

+1

ntziolis avatar May 10 '17 16:05 ntziolis

Since it looks like all standard packages are far ahead (@ angular is at 4.1.3, @ionic-native is at 3.9.2 and ionic-angular at 3.2.1) and I would like to follow at least ionic-angular quite closely I tried an update of a quite young meteor-angular2 project as well. Unfortunately without luck. After dropping angular2-google-maps and adjusting to the new @ionic-native naming convention things were still failing. For testing purpose I also remove all @ioinc-native parts but the app is even still failing on the browser with some "ERROR Error: No provider for ApplicationInitStatus!" in the modules.js.

This probably could be troubleshooted further but for someone without meteor-angular2 package insights this is tedious.

So maybe someone with those insight (or @Urigo ) could shed some light on the current problematic that causes the incompatibility. Is it even related to meteor-rxjs or angular2-compilers? And if so where lies the problem? I'd really love to stick with the meteor-angular2 packages but if following upstream updates is very complex and therefore may or may not happen, I would consider using less sophisticated but also less complex approaches. Anyways, it would be great to hear something on this topic!

tehXor avatar May 19 '17 00:05 tehXor

I see a lot of people that are having issues updating for ng2 to ng4 with meteor. I also had issues but I eventually got it to work (socially didnt work at first). I all by issues were in the modules.ts and main.ts where the AOT caused a lot of red herring exceptions. Just writing that to give assurance that meteor works with ng4.

Sent from my iPhone

On May 19, 2017, at 2:32 AM, ntziolis [email protected] wrote:

@tehXor We have been through this ourselves and what does indeed work when trying to use the latest Ionic + Ang 4 is: Use the Ionic CLI + build process (just following the meteor steps from the sample in our own project). It seems that right now the Meteor build pipeline creates issues due to version conflicts with TypeScript. The Ionic build process seems to be updated already.

This was our LAST resort. We don't like having 2 build processes for server ü client But meddled with the meteor CLI for way to long until we decided that right now it simply doesn't work without major surgery or superb understanding of what to change.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

jerradpatch avatar May 19 '17 15:05 jerradpatch

I was able to get it to work with the Ionic CLI, but not with the Meteor CLI. Can anyone confirm they have been able to get the Meteor CLI + Ionic 3 + Ang 4 to work?

ntziolis avatar May 19 '17 15:05 ntziolis

My goal: make it work in web and android

I have had all this week trying to make it work without success, this is my history log:

- Ionic 3 + Angular 4 + Meteor-Client-Bundler (api) 1.4 = Best approach, bootstrap well in browser / Android, then i have removed mys:accounts-phone and added accounts-password for login purpose and works good for web, hurray!!... but not in Android (using ionic CLI > ionic cordova run android), it just did not connect to my api.

- Meteor 1.4 + Ionic 3 + Angular 4 = After many hours of reading changes logs of one each framework for breaking changes and fixing packages versions trying avoid npm ERR! or unmet peer dependency.. not work for web and android, i cannot get rid of the error "Cannot read property 'meteorInstall' of undefined"or "Maximum call stack size exceeded " this last error on angular 2.4.8.

Conclusion: Reading change logs is a "must do" always and definitely the need to get more involved because it's really frustrating to spend hours trying to figure something out without the proper knowledge.

For example, to know that Meteor(1.4.4.2) use node 4.8.2 and ionic(3) use node 6+ makes a lot advantage when you are using npm install or meteor npm install.

rodrilink avatar May 19 '17 19:05 rodrilink

Just in case anybody else is interested: We still went with Meteor and Ionic/Angular for our current project but we tried to avoid as much complexity from the angular-meteor project(s).

So we installed a separate Meteor and a separate Ionic project which do not share any code. This means we have to define collections in both projects and our only 'glue' is meteor-rxjs and meteor-client-bundler where we make use of the options to specify an external Meteor project and an external URL.

This also means we have two build processes but we are very close to the 'original' Meteor and Ioinc ecosystem and have zero individual compilers (we also left out barbatus:typescript for Meteor) as it seems those add a lot of complexity for upstream updates, while wrapping Meteor functions and collections in rxjs observables (done by meteor-rxjs) and adding a meteor client (meteor-client-bundler) is less complex and updates will be required less often.

This seems to be fairly stable and personally I would appreciate it, if this project would as well remove the approach with two 'ways' (a Meteor CLI as well as a Ionic CLI) and instead focus on one way, maybe also with less complexity were only the very basics needed to combine Meteor with Ionic/Angular are maintained. The idea and also code of this project is great, however the past quite clearly shows that it is very poorly maintained in terms of reaction time. This makes using it as it is in projects meant for production impossible. Reducing the complexity greatly could allow a production-ready angular-meteor project without a great increase of maintenance time. But that's just imho ;-)

tehXor avatar May 26 '17 15:05 tehXor

@tehXor is that using angular 4?

rrubio avatar May 29 '17 04:05 rrubio

@tehXor, this solution is not bad at all.. I want to give it a try. Do you mind sharing a repo to illustrate how you did it?

aalhaimi avatar May 30 '17 09:05 aalhaimi

It works now! After reading various posts that Angular 4 works with Meteor, I decided to give it another try. I added the latest version of Meteor 1.5 and Angular 4.2.0-rc.2 to the Socially tutorial and it worked.

Here's a git repo of the working project.

https://github.com/cesargalindo/socially-step19-ang4.2.0-rc.2

cesargalindo avatar Jun 11 '17 03:06 cesargalindo

We've released angular2-meteor version 0.8.0 to support the latest versions of Angular (4 and 5). Thanks to this PR from @darkbasic .

Just a note, that we've updated this API even though we consider it a deprecated API, and you should probably slowly migrate your data solution to meteor-rxjs.

we've also published new angular-compilers package that supports all the features the Angular CLI gives you:

  • Typescript compilation
  • Assets compilation (HTML, styles)
  • Angular's AoT compilation
  • Rollup's bundling with Tree Shaking

and added a lot of examples with for all those features plus an example with Angular CLI if you want to use it instead of the Meteor CLI: https://github.com/Urigo/angular-meteor/tree/master/examples

We've also updated all the latest versions including the latest Angular 5 RC and Meteor 1.6.

Please open a new issue if you encountered one.

We've updated the Ionic CLI tutorial and in the process of updating the Meteor CLI one.

Urigo avatar Oct 31 '17 17:10 Urigo