Open ponwude opened 1 year ago
it appears there is a compatibility issue between the framework and google firebase related to the node-forge module.
By itself, version 2.5.0 of the framework works correctly.
By itself, initialising the google firebase works correctly.
Once you combine both modules in the same application, nodejs throws the error stated above.
downgrading the framework or firebase to an earlier version fixes the issue though.
Any ideas?
Hi @ponwude I tried to replicate this locally without luck, but I suspect that is mostly because I don't know anything about firebase.
I attempted to update the WebexSamples/webex-bot-starter: A template to deploy a bot in Webex Teams using the webex-node-bot-framework project to use the 2.5.0 version of the framework and added firebase as a dependency.
Without calling any firebase code, the bot started as normal. I then attempted to create a firebase project and initialize it from the code as described here: Add Firebase to your JavaScript project, but ran into some trouble getting the front end JS code working in my node project.
If you can help me figure out how to initialize firebase from a node app in order to replicate your problem, I'll look into it.
Here is what I'm doing:
// init firebase
// Import the functions you need from the SDKs you need
const firebase = require('firebase');
// Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
const firebaseConfig = {...} // credentials supplied on the Add Firebase to your App section of console
// Initialize Firebase
const firebaseApp = firebase.initializeApp(firebaseConfig);
const analytics = firebase.getAnalytics(firebaseApp);
When I attempt to run this I get:
$ node index.js
node:internal/modules/cjs/loader:556
throw e;
^
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in webex-bot-starter-with-firebase/node_modules/firebase/package.json
at new NodeError (node:internal/errors:399:5)
at exportsNotFound (node:internal/modules/esm/resolve:266:10)
at packageExportsResolve (node:internal/modules/esm/resolve:602:9)
at resolveExports (node:internal/modules/cjs/loader:550:36)
at Module._findPath (node:internal/modules/cjs/loader:619:31)
at Module._resolveFilename (node:internal/modules/cjs/loader:1046:27)
at Module._load (node:internal/modules/cjs/loader:905:27)
at Module.require (node:internal/modules/cjs/loader:1127:19)
at require (node:internal/modules/helpers:112:18)
at Object.<anonymous> (/Users/jpshipherd/MEGA/MEGAsync/dev/node/webex-bot-starter-with-firebase/index.js:14:16) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
Node.js v19.6.0
i get the error below when i upgrade the framework from version 2.3.14 to any version from 2.4.0 to 2.5.0
node:internal/url:565 throw new ERR_INVALID_URL(input); ^
TypeError [ERR_INVALID_URL]: Invalid URL at new NodeError (node:internal/errors:400:5) at URL.onParseError (node:internal/url:565:9) at new URL (node:internal/url:645:5) at Object. (/Users/masterp/Desktop/Webex/node_modules/node-forge/lib/log.js:303:15)
at Module._compile (node:internal/modules/cjs/loader:1218:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
at Module.load (node:internal/modules/cjs/loader:1081:32)
at Module._load (node:internal/modules/cjs/loader:922:12)
at Module.require (node:internal/modules/cjs/loader:1105:19)
at require (node:internal/modules/cjs/helpers:103:18) {
input: '',
code: 'ERR_INVALID_URL'
}
Once i downgrade, it works like a charm.
i am running on Node.js v18.13.0
Any help please.