Skip to content
This repository has been archived by the owner on Mar 9, 2021. It is now read-only.

Angular2 error TS2307: Cannot find module 'nativescript-opentok'. #44

Open
Giannmit opened this issue Aug 3, 2017 · 1 comment
Open

Comments

@Giannmit
Copy link

Giannmit commented Aug 3, 2017

First off, really excited to use Tokbox on angular2. I followed the instructions for the Opentok angular2 integration and am still having this issue. I have tried re installing the module and re running npm install. Was wondering if there is something I am missing in the instructions?
screen shot 2017-08-02 at 8 08 26 pm
screen shot 2017-08-02 at 8 08 54 pm
screen shot 2017-08-02 at 8 09 27 pm

@leocaseiro
Copy link

leocaseiro commented Sep 4, 2017

I was having the same issue. I believe the missing index.d.ts in the main folder of the npm exported plugin is the issue.

A work around is calling the /opentok which is the main file of the project (found it on package.json).

import { TNSOTSession, TNSOTPublisher, TNSOTSubscriberI } from 'nativescript-opentok/opentok';

If you still having issues with your typos. Something like:

error TS2305: Module '"Project/node_modules/nativescript-opentok/opentok"' has no exported member 'TNSOTSubscriberI'.

try uncomment the // export * from './src/common'; from the node_modules/nativescript-opentok/opentok.d.ts file.

/**
 * iOS and Android apis should match.
 * It doesn't matter if you export `.ios` or `.android`, either one but only one.
 */
export * from './opentok.ios';

// Export any shared classes, constants, etc.
export * from './src/common'; // this line

I'll open a PR for that fix.

leocaseiro added a commit to leocaseiro/nativescript-opentok that referenced this issue Sep 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants