I am at this the third day now, but can't find the way to successfully use the AppDevPack on my local angular app. I am working on a Mac, I have Angular v 8.15.0. I was able to successfully install the library but when ever I wan't to compile it, it breaks. To describe: I've done almost everything to the script. The only difference is that I have made a service in which the @domino lives(it is not directly on a component). The main problem seems to be with grpc and then with stream.
import { Injectable } from '@angular/core';
//import { useServer } from '@domino/domino-db/';
import * as useServer from '../../../node_modules/@domino/domino-db';
@Injectable({
providedIn: 'root'
})
export class DominoService {
private serverConfig = {
hostName: 'http://www.hostname.com/',
connection: { port:'3002'}
};
private databaseConfig = {
filePath: 'dev-tmp.nsf'
};
public database: any;
constructor() {
useServer( this.serverConfig ).then( async server => {
this.database = await server.useDatabase( this.databaseConfig );
});
const coll = this.database.bulkReadDocuments({
query: "Form = 'Document'"
});
console.log("Returned docs:" + JSON.stringify(coll));
}
Here are some of the errors:
Critical dependency: the request of a dependency is an expression
WARNING in ./node_modules/@domino/domino-db/node_modules/grpc/node_modules/node-pre-gyp/lib/pre-binding.js 20:22-48 Critical dependency: the request of a dependency is an expression
WARNING in ./node_modules/@domino/domino-db/node_modules/grpc/node_modules/node-pre-gyp/lib/util/versioning.js 17:20-67 Critical dependency: the request of a dependency is an expression
WARNING in ./node_modules/@domino/domino-db/node_modules/grpc/node_modules/minimatch/minimatch.js Module not found: Error: Can't resolve 'path' in '/Users/…/node_modules/@domino/domino-db/node_modules/grpc/node_modules/minimatch'
ERROR in ./node_modules/@domino/domino-db/node_modules/grpc/node_modules/detect-libc/lib/detect-libc.js Module not found: Error: Can't resolve 'child_process' in ‘/…/node_modules/@domino/domino-db/node_modules/grpc/node_modules/detect-libc/lib' Error: Can't resolve 'path' in '/Users/.../node_modules/@domino/domino-db/node_modules/grpc/node_modules/minimatch' ERROR in ./node_modules/@domino/domino-db/node_modules/grpc/node_modules/detect-libc/lib/detect-libc.js Module not found: Error: Can't resolve 'child_process' in '/Users/.../node_modules/@domino/domino-db/node_modules/grpc/node_modules/detect-libc/lib' ERROR in ./node_modules/@domino/domino-db/node_modules/grpc/src/client.js Module not found: Error: Can't resolve 'stream' in '/Users/.../node_modules/@domino/domino-db/node_modules/grpc/src'
From the error message, I can see that you're trying to webpack this. We do not support running domino-db on a webpage. Even if you got past this error, domino-db would fail to load in that environment because it's insecure.
Domino-db in production, secure environments requires client credentials to log in. Those aren't things you want to appear in the browser page.