OneSignal / onesignal-node-api

OneSignal Node Client
Other
30 stars 17 forks source link

[Bug]: 1.0.0-beta5 package broken #38

Closed bishsbytes closed 1 year ago

bishsbytes commented 1 year ago

What happened?

The latest NPM package doesn't contain the 'dist' folder, so the module can't be included.

Steps to reproduce?

Install 1.0.0-beta5 into project and try to run.

What did you expect to happen?

To work.

Have had to fix my dependency to 1.0.0-beta4 for my project to build and run.

Relevant log output

Nov 15 16:45:51 ip-xxx-xxx-xxx web: Error: Cannot find module '/var/app/current/dist/apps/api-team/node_modules/@onesignal/node-onesignal/dist/index.js'
Nov 15 16:45:51 ip-xxx-xxx-xxx web: at createEsmNotFoundErr (node:internal/modules/cjs/loader:1012:15)
Nov 15 16:45:51 ip-xxx-xxx-xxx web: at finalizeEsmResolution (node:internal/modules/cjs/loader:1005:15)
Nov 15 16:45:51 ip-xxx-xxx-xxx web: at resolveExports (node:internal/modules/cjs/loader:522:14)
Nov 15 16:45:51 ip-xxx-xxx-xxx web: at Function.Module._findPath (node:internal/modules/cjs/loader:562:31)
Nov 15 16:45:51 ip-xxx-xxx-xxx web: at Function.Module._resolveFilename (node:internal/modules/cjs/loader:971:27)
Nov 15 16:45:51 ip-xxx-xxx-xxx web: at Function.Module._load (node:internal/modules/cjs/loader:833:27)
Nov 15 16:45:51 ip-xxx-xxx-xxx web: at Module.require (node:internal/modules/cjs/loader:1057:19)
Nov 15 16:45:51 ip-xxx-xxx-xxx web: at require (node:internal/modules/cjs/helpers:103:18)
Nov 15 16:45:51 ip-xxx-xxx-xxx web: at Object.4124 (/var/app/current/dist/apps/api-team/main.js:57:952744)
Nov 15 16:45:51 ip-xxx-xxx-xxx web: at __webpack_require__ (/var/app/current/dist/apps/api-team/main.js:57:972415) {
Nov 15 16:45:51 ip-xxx-xxx-xxx web: code: 'MODULE_NOT_FOUND',
Nov 15 16:45:51 ip-xxx-xxx-xxx web: path: '/var/app/current/dist/apps/api-team/node_modules/@onesignal/node-onesignal/package.json'
Nov 15 16:45:51 ip-xxx-xxx-xxx web: }

Code of Conduct

callmeteus commented 1 year ago

Yeah, suddenly broke our applications. Will be reverting temporarily to beta4 until it's fixed.

brandellcassio commented 1 year ago

Even for beta4, I'm receiving this error.

Error: Cannot find module '/usr/src/app/node_modules/@onesignal/node-onesignal/dist/index.js'
    at createEsmNotFoundErr (node:internal/modules/cjs/loader:960:15)
    at finalizeEsmResolution (node:internal/modules/cjs/loader:953:15)
    at resolveExports (node:internal/modules/cjs/loader:482:14)
    at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/usr/src/app/dist/notification/dal/one-signal/notification-database.service.js:23:32)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
kesheshyan commented 1 year ago

Hey guys, thanks for reporting this issue. It seems like we are having some problem with the NPM publish GitHub action that for some reason does not pick up the dist/ folder. I'm currently trying to fix this problem and I'll update this issue when it's done.

Meanwhile, as a temporally solution you can go to

node_modules/@onesignal/node-onesignal/

and run the following command manually: npm run build

kesheshyan commented 1 year ago

It seems like I was able to fix this issue. Please checkout out to the version 1.0.0-beta7

Please feel free to reopen this issue if the problem persists.