alphamikle / nest_transact

Simplest transactions support for Nestjs with Typeorm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error in import of library

darkyelox opened this issue · comments

The version 1.1.2 throws me the error:

Error: Cannot find module '/var/server/node_modules/nest-transact/index.js'. Please verify that the package.json has a valid "main" entry
    at tryPackage (internal/modules/cjs/loader.js:295:19)
    at Function.Module._findPath (internal/modules/cjs/loader.js:508:18)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:802:27)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/var/server/dist/modules/benefits/benefits.service.js:34:25)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32) {
  code: 'MODULE_NOT_FOUND',
  path: '/var/server/node_modules/nest-transact/package.json',
  r

Reverting to 1.0.2 got rid of the problem, the problem seems to be that there isn't any index.js in that published version of the library

I have the same problem.

@darkyelox, @teje87

Hello! Sorry for the long answer - I don't have enough time :(

I fixed this issue in version 1.1.3 - please update your versions to the latest and check - if is all ok

Hi Mike!

Thanks for your response and effort! Upgraded to 1.1.3 and the import issue seems to be fixed. Now I'm facing some problems trying to work with custom repositories, it could be related with the new version changes?

I can use any of the base repository methods ( find, finOne... ) without any problem, but when I try to use any custom method it says that is not a function.

Hi, @teje87 I will see the reason for this trouble soon.

@teje87 I think I have the same problem and also the fix for this: see #6

@teje87 Hello! If you can send a pull request to fix this problem - this will be cool! I accept PR if they do work and haven't new bugs. To check this - you can run an example project - it is like a test field. And there are some custom repositories too, which works normally, as I know. Best regards!

Main problem of issue was fixed (broken build)