When trying to use the library in TypeScript I get the following error messages:
AppComponent_Host.html:1 ERROR TypeError: Arguments to path.resolve must be strings
at Object.exports.resolve (index.js:71)
at findCompiledModule (nbind.js:70)
at find (nbind.js:93)
at Object.init (nbind.js:104)
at new AppComponent (app.component.ts:15)
at createClass (core.es5.js:10910)
at createDirectiveInstance (core.es5.js:10751)
at createViewNodes (core.es5.js:12192)
at createRootView (core.es5.js:12082)
Unhandled Promise rejection: Arguments to path.resolve must be strings ; Zone: <root> ; Task: Promise.then ; Value: TypeError: Arguments to path.resolve must be strings
at Object.exports.resolve (index.js:71)
at findCompiledModule (nbind.js:70)
at find (nbind.js:93)
at Object.init (nbind.js:104)
at new AppComponent (app.component.ts:15)
at createClass (core.es5.js:10910)
at createDirectiveInstance (core.es5.js:10751)
at createViewNodes (core.es5.js:12192)
at createRootView (core.es5.js:12082)
at callWithDebugContext (core.es5.js:13467) TypeError: Arguments to path.resolve must be strings
at Object.exports.resolve (file:///E:/Projects/streaming/using_nan/streampp/dist/vendor.bundle.js:62294:13)
at findCompiledModule (file:///E:/Projects/streaming/using_nan/streampp/dist/vendor.bundle.js:62132:45)
at find (file:///E:/Projects/streaming/using_nan/streampp/dist/vendor.bundle.js:62155:13)
at Object.init (file:///E:/Projects/streaming/using_nan/streampp/dist/vendor.bundle.js:62166:5)
at new AppComponent (file:///E:/Projects/streaming/using_nan/streampp/dist/main.bundle.js:107:62)
at createClass (file:///E:/Projects/streaming/using_nan/streampp/dist/vendor.bundle.js:11434:20)
at createDirectiveInstance (file:///E:/Projects/streaming/using_nan/streampp/dist/vendor.bundle.js:11275:37)
at createViewNodes (file:///E:/Projects/streaming/using_nan/streampp/dist/vendor.bundle.js:12716:53)
at createRootView (file:///E:/Projects/streaming/using_nan/streampp/dist/vendor.bundle.js:12606:5)
at callWithDebugContext (file:///E:/Projects/streaming/using_nan/streampp/dist/vendor.bundle.js:13991:42)
Everything compiles. Typings are being generated to src/lib-types.d.ts. Importing nbind seems to work. LibTypes seems undefined in the devtools debugger though.
The code I'm using to import and use the module is:
import { Component } from '@angular/core';
import * as nbind from 'nbind';
import * as LibTypes from './../lib-types';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'app works!';
constructor() {
const lib = nbind.init<typeof LibTypes>().lib;
lib.Greeter.sayHello('Hello');
}
}
I also tried the async method, but it gave the same error. How can I fix this?
When trying to use the library in TypeScript I get the following error messages:
I am trying to get nbind to work with the Electron Angular Boilerplate at https://github.com/stokingerl/Angular2-Electron-Boilerplate. I forked the repo at https://github.com/kayvanbree/Angular2-Electron-Nbind-Boilerplate.
I updated the package.json to look like this:
Everything compiles. Typings are being generated to src/lib-types.d.ts. Importing nbind seems to work. LibTypes seems undefined in the devtools debugger though.
The code I'm using to import and use the module is:
I also tried the async method, but it gave the same error. How can I fix this?