Giter Site home page Giter Site logo

Cant not inject Entity Manager about nestjs HOT 3 CLOSED

mikro-orm avatar mikro-orm commented on September 2, 2024 1
Cant not inject Entity Manager

from nestjs.

Comments (3)

rat-matheson avatar rat-matheson commented on September 2, 2024

Did you have any progress with this? I'm having the same issue. In my case, I'm trying to use the SqlEntityManager in a forFeature module. I'm using sqlite.

Dependency Version
node 16.13.2
typescript 4.3.5
mikro-orm 5.1.2
your-driver @mikro-orm/sqlite"@^5.1.2

Update:

I solved my particular issue. I was importing libraries via tsconfig.paths. This meant that they didn't all refer to the same node_modules folder. Based on some other issue threads in this repository, I learned that if the mikro-orm driver/knex libraries get installed in multiple node_modules, the nest js dependency injector won't be able to inject the same instance across all packages (which is probably the intention).

To fix, I updated all my tsconfig.paths to refer to projects that all share the same node_modules folder (so just one node_modules folder)

from nestjs.

B4nan avatar B4nan commented on September 2, 2024

I will need a complete reproductions for this, but so far this sounds more like misconfigurations than bugs.

With that said, there is a problem with EM injection when the nest js requests scopes are used (#67).

from nestjs.

B4nan avatar B4nan commented on September 2, 2024

Lets reopen with a reproduction if #82 does not help. But the OP seems like you just used wrong package for import.

from nestjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.