TeamMaestro / nativescript-opentok

Integrates OpenTok (TokBox) WebRTC for NativeScript.
Other
10 stars 16 forks source link

Error: File is not under 'rootDir'. 'rootDir' is expected to contain all source files. #8

Closed jmw-84 closed 8 years ago

jmw-84 commented 8 years ago

I tried to implement your plugin in my angular2 project and getting these errors during compilation:

error TS6059: File '../node_modules/nativescript-opentok/opentok.ios.ts' is not under 'rootDir' '../app'. 'rootDir' is expected to contain all source files.

error TS6059: File '../node_modules/nativescript-opentok/src/common.ts' is not under 'rootDir' '../app'. 'rootDir' is expected to contain all source files.

error TS6059: File '../node_modules/nativescript-opentok/src/ios/publisher-delegate.ts' is not under 'rootDir' '../app'. 'rootDir' is expected to contain all source files.

error TS6059: File '../node_modules/nativescript-opentok/src/ios/publisher.ts' is not under 'rootDir' '../app'. 'rootDir' is expected to contain all source files.
error TS6059: File '../node_modules/nativescript-opentok/src/ios/session-delegate.ts' is not under 'rootDir' '../app'. 'rootDir' is expected to contain all source files.
error TS6059: File '../node_modules/nativescript-opentok/src/ios/session.ts' is not under 'rootDir' '../app'. 'rootDir' is expected to contain all source files.

I guess it's a similar problem to "Remove *.ts files from src during publishing to npm": https://github.com/ocombe/ng2-translate/issues/4

Thank you

sean-perkins commented 8 years ago

@jmw-84 Try running npm install again, I pushed another version that should ignore typescript files on publish.

jmw-84 commented 8 years ago

Hmm, in the file where I do the import

import {TNSOTSession} from "nativescript-opentok";

I get this error again

error TS2307: Cannot find module 'nativescript-opentok'.
sean-perkins commented 8 years ago

@jmw-84 Try one more time (npm install). I believe the typings should be shipped with 1.2.4 now.

jmw-84 commented 8 years ago

Still the same error, I believe it could have something to do with package.json

"typings": "index.d.ts",

no longer exists after "#8 Ignore typescript files on publish"?

sean-perkins commented 8 years ago

@jmw-84 Good call. Try again! 1.2.5 haha.

https://github.com/sean-perkins/nativescript-opentok/commit/8d6a30f30ab5c4c5fdb534be847565487ea426de

jmw-84 commented 8 years ago

Nope, it seems like angular2 needs the ts files to compile, but if i add them i get the rootDir errors. I'm pretty new to this and don't really know, and now I think your demo gets the same error again. Sorry =/

sean-perkins commented 8 years ago

@jmw-84 No worries. Let me try to implement the plugin into an example project. This issue will remain open until then.

Thanks for reporting it!

jmw-84 commented 8 years ago

Thank you, I really appreciate your help. I haven't had any luck finding the problem yet.

sean-perkins commented 8 years ago

@jmw-84 It's a combo issue. First the .ts extensions should not be included in the NPM package, but also the typings definition .d.ts is not outlined and generated correctly. I'll manually declare the typings definitions and update the package this weekend!

sean-perkins commented 8 years ago

@jmw-84 Try one more time, I believe it is resolved now. I was able to get type completion in a new project. You should be on version 1.2.10.

jmw-84 commented 8 years ago

Awesome! It is resolved now, works as intended in my ng2 project. Thank you so much Sean, have a nice weekend!

mabelanski commented 7 years ago

Hi guys,

I still have this error and i work with v2.0.1

error TS2307: Cannot find module 'nativescript-opentok'.

Thanks