Using this with the Mongoose module
See original GitHub issueI’m submitting a…
[ ] Regression
[ x] Bug report
[ ] Feature request
[ ] Documentation issue or request
Current behavior
I was attempting to connect a MongoDB instance and had an interesting time tracking down exactly why my app wasn’t starting. As soon as I removed the AngularUniversalModule from the AppModule imports… my app started right up.
I spent the better part of the day tracking down what the issue might be to no solution. I attempted to make the AngularUniversalModule Dynamic and just tossed an await on a timer, however it stops all imports until the timer is over. So I’m obviously not quite as familiar with how this framework works. Maybe I just missed something?
Expected behavior
It seems like this Module needs to load after the Mongo Connection?
Minimal reproduction of the problem with instructions
https://github.com/robstadnick/nest-mongoose (edit: created new repo) There is a TODO on the app.module.ts above the code to comment out to view issue. dev - npm run serve prod - npm run build && npm start
What is the motivation / use case for changing the behavior?
Using this module and the Mongoose module together. Maybe there is a round about solution but it would be great to pass something into the forRoot() or have it instinctively load last?
Environment
Nest version: 6.5.3
- nestjs/ng-universal: 2.0.0
- @nestjs/mongoose: 6.1.2
For Tooling issues:
- Node version: 10.16.0
- Platform: Mac
Others:
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top GitHub Comments
Plus one.
Unfortunately, some Node.js packages (especially native bindings) cannot be easily bundled using Webpack. In order to get rid of errors, you have to adjust your webpack configuration (
webpack.server.config.js
):Then, it will work fine (keep in mind that you’ll have to install
mongoose
package alongside your bundle because it’s excluded from the compilation).PS. If you’re also using
mongodb
package directly, you might need to exclude it as well: