Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find namespace #189

Open
michaelb-01 opened this issue Nov 26, 2017 · 4 comments
Open

Cannot find namespace #189

michaelb-01 opened this issue Nov 26, 2017 · 4 comments

Comments

@michaelb-01
Copy link

I'm getting the following errors, any idea how to resolve it?

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'.

@michaelb-01
Copy link
Author

michaelb-01 commented Nov 26, 2017

This is my package.json:

{
  "name": "pipe6",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "webpack-dev-server --port=4200",
    "build": "webpack",
    "meteor-client:bundle": "meteor-client bundle -s api",
    "server": "cd api && meteor",
    "test": "karma start ./karma.conf.js",
    "lint": "ng lint",
    "e2e": "protractor ./protractor.conf.js",
    "pree2e": "webdriver-manager update --standalone false --gecko false --quiet"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^5.0.0",
    "@angular/cdk": "^5.0.0-rc.1",
    "@angular/common": "^5.0.0",
    "@angular/compiler": "^5.0.0",
    "@angular/core": "^5.0.0",
    "@angular/forms": "^5.0.0",
    "@angular/http": "^5.0.0",
    "@angular/material": "^5.0.0-rc.1",
    "@angular/platform-browser": "^5.0.0",
    "@angular/platform-browser-dynamic": "^5.0.0",
    "@angular/router": "^5.0.0",
    "babel-runtime": "^6.26.0",
    "bcrypt": "^1.0.3",
    "core-js": "^2.4.1",
    "hammerjs": "^2.0.8",
    "meteor-node-stubs": "^0.3.2",
    "meteor-rxjs": "^0.4.8",
    "meteor-typings": "^1.4.1",
    "rxjs": "^5.5.2",
    "zone.js": "^0.8.14"
  },
  "devDependencies": {
    "@angular/cli": "1.5.4",
    "@angular/compiler-cli": "^5.0.0",
    "@angular/language-service": "^5.0.0",
    "@types/chai": "^4.0.5",
    "@types/jasmine": "~2.5.53",
    "@types/jasminewd2": "~2.0.2",
    "@types/meteor": "^1.4.12",
    "@types/mocha": "^2.2.44",
    "@types/node": "^6.0.92",
    "@types/underscore": "^1.8.5",
    "autoprefixer": "^6.5.3",
    "circular-dependency-plugin": "^3.0.0",
    "codelyzer": "^4.0.1",
    "copy-webpack-plugin": "^4.1.1",
    "css-loader": "^0.28.1",
    "cssnano": "^3.10.0",
    "exports-loader": "^0.6.3",
    "file-loader": "^1.1.5",
    "html-webpack-plugin": "^2.29.0",
    "istanbul-instrumenter-loader": "^2.0.0",
    "jasmine-core": "~2.6.2",
    "jasmine-spec-reporter": "~4.1.0",
    "karma": "~1.7.0",
    "karma-chrome-launcher": "~2.1.1",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "less-loader": "^4.0.5",
    "postcss-loader": "^2.0.8",
    "postcss-url": "^7.1.2",
    "protractor": "~5.1.2",
    "raw-loader": "^0.5.1",
    "sass-loader": "^6.0.3",
    "source-map-loader": "^0.2.0",
    "style-loader": "^0.13.1",
    "stylus-loader": "^3.0.1",
    "tmp": "0.0.33",
    "ts-node": "~3.2.0",
    "tslint": "~5.7.0",
    "typescript": "2.5.2",
    "uglifyjs-webpack-plugin": "1.0.0",
    "url-loader": "^0.6.2",
    "webpack": "~3.8.1",
    "webpack-concat-plugin": "1.4.0",
    "webpack-dev-server": "~2.9.3"
  }
}

@mbtechnologyil
Copy link

anyone?

@hongan126
Copy link

hongan126 commented Jan 15, 2018

Check your tsconfig.json, need exclude 'api/node_modules':

{
  "compileOnSave": false,
  "compilerOptions": {
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "baseUrl": ".",
    "declaration": false,
    "module": "commonjs",
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "skipLibCheck": true,
    "stripInternal": true,
    "noImplicitAny": false,
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2017",
      "dom"
    ]
  },
  "include": [
    "src/**/*.ts",
    "api/**/*.ts"
  ],
  "exclude": [
    "node_modules",
    "api/node_modules",  //<---here
    "api"
  ]
}

and the same in "src/tsconfig.app.json":

{{
  "extends": "../tsconfig.json",
  "compilerOptions": {
    "outDir": "../out-tsc/app",
    "baseUrl": "./",
    "module": "es2015",
    "types": []
  },
  "exclude": [
    "test.ts",
    "**/*.spec.ts",
    "../api/node_modules" //<---here
  ]
}

and in "src/tsconfig.spec.json":

{
{
  "extends": "../tsconfig.json",
  "compilerOptions": {
    "outDir": "../out-tsc/spec",
    "baseUrl": "./",
    "module": "commonjs",
    "target": "es5",
    "types": [
      "jasmine",
      "node"
    ]
  },
  "files": [
    "test.ts"
  ],
  "include": [
    "**/*.spec.ts",
    "**/*.d.ts",
    "../api/node_modules" //<---here
  ]
}

Hope this helpfull for you.

@jashka34
Copy link

jashka34 commented Dec 11, 2018

You need add to tsconfig.json section types like that:

  "compilerOptions": {
    "module": "commonjs",
    "target": "ES5",
...
    "types": [
      "node", // <---optional here
      "meteor-typings" // <---here
    ]
  },
...
}

node - optional

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants