Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version after 4.1.2 added a dependency on tslib? #356

Closed
demurray opened this issue May 4, 2020 · 3 comments · Fixed by #357
Closed

Version after 4.1.2 added a dependency on tslib? #356

demurray opened this issue May 4, 2020 · 3 comments · Fixed by #357

Comments

@demurray
Copy link

demurray commented May 4, 2020

After upgrading from 4.1.2 -> 4.1.9 of @promster/express, my application encountered the following error:

internal/modules/cjs/loader.js:796
    throw err;
    ^
Error: Cannot find module 'tslib'
Require stack:
- /usr/src/app/node_modules/@promster/express/dist/modules/middleware/middleware.js
- /usr/src/app/node_modules/@promster/express/dist/modules/middleware/index.js
- /usr/src/app/node_modules/@promster/express/dist/modules/index.js
- SNIP
- SNIP
- /usr/src/app/src/app.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:793:17)
    at Function.Module._load (internal/modules/cjs/loader.js:686:27)
    at Module.require (internal/modules/cjs/loader.js:848:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/usr/src/app/node_modules/@promster/express/dist/modules/middleware/middleware.js:3:17)
    at Module._compile (internal/modules/cjs/loader.js:955:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
    at Module.load (internal/modules/cjs/loader.js:811:32)
    at Function.Module._load (internal/modules/cjs/loader.js:723:14)
    at Module.require (internal/modules/cjs/loader.js:848:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/usr/src/app/node_modules/@promster/express/dist/modules/middleware/index.js:3:22)
    at Module._compile (internal/modules/cjs/loader.js:955:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
    at Module.load (internal/modules/cjs/loader.js:811:32)
    at Function.Module._load (internal/modules/cjs/loader.js:723:14) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/usr/src/app/node_modules/@promster/express/dist/modules/middleware/middleware.js',
    '/usr/src/app/node_modules/@promster/express/dist/modules/middleware/index.js',
    '/usr/src/app/node_modules/@promster/express/dist/modules/index.js',
    SNIP,
    SNIP,
    SNIP
  ]

tslib is not listed as a dependency in https://github.com/tdeekens/promster/blob/master/packages/express/package.json, but in the compiled code under node_modules/@promster/express/dist/modules/middleware/middleware.js, there is

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const http_1 = require("http");

I can work around this by requiring tslib in my own application, but shouldn't @promster/express require its own dependencies?

@tdeekens
Copy link
Owner

tdeekens commented May 5, 2020

Thanks for reporting. Interesting, I didn't run into this when updating certain apps to the same version and package. Maybe tslib was floating around somewhere already avoiding the issue. I think it's correct what you're suggesting to require tslib within promster.

Would you mind opening a PR to add it as a dependency to all packages?

@tdeekens
Copy link
Owner

tdeekens commented May 5, 2020

Enjoy :)

Successfully published:
 - @promster/[email protected]
 - @promster/[email protected]
 - @promster/[email protected]
 - @promster/[email protected]
 - @promster/[email protected]
 - @promster/[email protected]
 - @promster/[email protected]

@demurray
Copy link
Author

demurray commented May 5, 2020

Thanks for jumping on this. Can confirm that this fixes the error for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants