darkbasic / angularcli-meteor

13 stars 4 forks source link

Cannot find namespace error #4

Closed michaelb-01 closed 6 years ago

michaelb-01 commented 6 years ago

I'm combining this approach with the angular-meteor tutorial (which is very similar). It's almost working but i'm getting the following errors:

ERROR in api/node_modules/meteor-rxjs/dist/MeteorObservable.d.ts(123,34): error TS2503: Cannot find namespace 'Tracker'. api/node_modules/meteor-rxjs/dist/ObservableCollection.d.ts(3,19): error TS2503: Cannot find namespace 'Mongo'. api/node_modules/meteor-rxjs/dist/ObservableCollection.d.ts(4,19): error TS2503: Cannot find namespace 'Mongo'. api/node_modules/meteor-rxjs/dist/ObservableCollection.d.ts(5,24): error TS2503: Cannot find namespace 'Mongo'. api/node_modules/meteor-rxjs/dist/ObservableCollection.d.ts(6,25): error TS2503: Cannot find namespace 'Mongo'. api/node_modules/meteor-rxjs/dist/ObservableCollection.d.ts(7,19): error TS2503: Cannot find namespace 'Mongo'. api/node_modules/meteor-rxjs/dist/ObservableCollection.d.ts(28,42): error TS2503: Cannot find namespace 'Mongo'. api/node_modules/meteor-rxjs/dist/ObservableCollection.d.ts(47,46): error TS2503: Cannot find namespace 'Mongo'. api/node_modules/meteor-rxjs/dist/ObservableCollection.d.ts(52,30): error TS2503: Cannot find namespace 'Mongo'. api/node_modules/meteor-rxjs/dist/ObservableCursor.d.ts(19,30): error TS2503: Cannot find namespace 'Mongo'. api/node_modules/meteor-rxjs/dist/ObservableCursor.d.ts(25,25): error TS2503: Cannot find namespace 'Mongo'. api/node_modules/meteor-rxjs/dist/ObservableCursor.d.ts(30,22): error TS2503: Cannot find namespace 'Mongo'. api/node_modules/meteor-rxjs/dist/ObservableCursor.d.ts(59,33): error TS2503: Cannot find namespace 'Meteor'. api/node_modules/meteor-rxjs/dist/ObservableCursor.d.ts(66,40): error TS2503: Cannot find namespace 'Meteor'. api/node_modules/meteor-rxjs/dist/ObservableCursor.d.ts(74,28): error TS2503: Cannot find namespace 'Mongo'. api/server/models/job.ts(28,9): error TS2503: Cannot find namespace 'Mongo'. node_modules/meteor-rxjs/dist/MeteorObservable.d.ts(123,34): error TS2503: Cannot find namespace 'Tracker'. node_modules/meteor-rxjs/dist/ObservableCollection.d.ts(3,19): error TS2503: Cannot find namespace 'Mongo'. node_modules/meteor-rxjs/dist/ObservableCollection.d.ts(4,19): error TS2503: Cannot find namespace 'Mongo'. node_modules/meteor-rxjs/dist/ObservableCollection.d.ts(5,24): error TS2503: Cannot find namespace 'Mongo'. node_modules/meteor-rxjs/dist/ObservableCollection.d.ts(6,25): error TS2503: Cannot find namespace 'Mongo'. node_modules/meteor-rxjs/dist/ObservableCollection.d.ts(7,19): error TS2503: Cannot find namespace 'Mongo'. node_modules/meteor-rxjs/dist/ObservableCollection.d.ts(28,42): error TS2503: Cannot find namespace 'Mongo'. node_modules/meteor-rxjs/dist/ObservableCollection.d.ts(47,46): error TS2503: Cannot find namespace 'Mongo'. node_modules/meteor-rxjs/dist/ObservableCollection.d.ts(52,30): error TS2503: Cannot find namespace 'Mongo'. node_modules/meteor-rxjs/dist/ObservableCursor.d.ts(19,30): error TS2503: Cannot find namespace 'Mongo'. node_modules/meteor-rxjs/dist/ObservableCursor.d.ts(25,25): error TS2503: Cannot find namespace 'Mongo'. node_modules/meteor-rxjs/dist/ObservableCursor.d.ts(30,22): error TS2503: Cannot find namespace 'Mongo'. node_modules/meteor-rxjs/dist/ObservableCursor.d.ts(59,33): error TS2503: Cannot find namespace 'Meteor'. node_modules/meteor-rxjs/dist/ObservableCursor.d.ts(66,40): error TS2503: Cannot find namespace 'Meteor'. node_modules/meteor-rxjs/dist/ObservableCursor.d.ts(74,28): error TS2503: Cannot find namespace 'Mongo'.

Any idea how to resolve that?

michaelb-01 commented 6 years ago

Anybody?

darkbasic commented 6 years ago

Your question is too generic. It seems you didn't patch your webpack.config.js properly, or maybe you didn't run meteor-client-bundler at all, but without further details it's impossible to help you. You should clone this repo (possiblly the testing-2 branch which is newer: https://github.com/darkbasic/angularcli-meteor/tree/testing-2), start making changes on top of that and tell me exactly which change breaks it.

michaelb-01 commented 6 years ago

I did as you said and cloned your latest branch. The first error I get is "Cannot find namespace 'Mongo'" when creating the following model ('entity.ts') inside api/server/models. Do I need to import 'Mongo' here? Where do I import it from?

export interface Entity {
  _id?: Mongo.ObjectID;
  job: {
    jobId: string,
    jobName: string
  };
  name: string;
  type: string;
  tasks: any[];
  status: string;
  thumbUrl?: string;
  description?: string;
  todos?: any[];  
  path?: string;
  public: boolean;
}
michaelb-01 commented 6 years ago

Think I’ve solved that, I can import it from meteor/mongo.

I’ll keep adding my code until it breaks again!

darkbasic commented 6 years ago

Think I’ve solved that, I can import it from meteor/mongo.

Exactly. Feel free to reopen.

michaelb-01 commented 6 years ago

Hi so it seems to be bcrypt (or npm-bcrypt) that is screwing everything up. Once I install that in my meteor project I start getting errors like:

Cannot find module 'postcss-custom-properties'

Then if I install that I get some ng-tools error..

I was following the steps from this tutorial (https://angular-meteor.com/tutorials/whatsapp2/ionic/authentication) but using accounts-base instead of accounts-phone

michaelb-01 commented 6 years ago

Similar problem to this:

https://github.com/facebookincubator/create-react-app/issues/788

Is it recommended to install bcrypt-js instead?

darkbasic commented 6 years ago

Basically that link says that bcrypt can be used on the server only. Probably you could use two separates node_modules folders if you want to use it on the server.