[ ] Regression
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
When trying to build a microservice by running nest build {app_name} webpack fails loading @nestjs/microservices.
My project is using the monorepo mode. I can reproduce the issue in windows and
in alpine linux.
Here is an excerpt from the final microservice main.js in the dist folder:
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = __webpack_require__(1);
const common_1 = __webpack_require__(2);
const microservices_1 = __webpack_require__(!(function webpackMissingModule() { var e = new Error("Cannot find module '@nestjs/microservices'"); e.code = 'MODULE_NOT_FOUND'; throw e; }()));
Note: Browsing the discord (channel nestjs-cli), I have noticed that a few other people are having the same problem.
Should find the reference to @nestjs/microservices and bundle successfully.
Being able to successfully build micro-service applications in a monorepo structure using the cli.
WINDOWS
[System Information]
OS Version : Windows 10
NodeJS Version : v10.16.2
NPM Version : 6.11.3
[Nest Information]
platform-express version : 6.8.3
microservices version : 6.8.3
passport version : 6.1.0
swagger version : 3.1.0
common version : 6.8.3
core version : 6.8.3
jwt version : 6.1.1
ALPINE LINUX (Docker)
[System Information]
OS Version : Linux 4.9
NodeJS Version : v10.16.3
NPM Version : 6.9.0
[Nest Information]
platform-express version : 6.8.3
microservices version : 6.8.3
passport version : 6.1.0
swagger version : 3.1.0
common version : 6.8.3
core version : 6.8.3
jwt version : 6.1.1
Can you share the repository which reproduces your issue?
@kamilmysliwiec the original code base is on a private repository, so I created a demo repo that demonstrates the issues I am facing:
https://github.com/alexbuczynsky/demo-mono-repo-issues
The README contains instructions on how to reproduce the error
I just downloaded and built from master. Loading the lazy modules using the changes you implemented in e9e0c32a0060d7f0a8fa5b02313ca59f820e8d9b for V6.10.5 solves my problem
Looking forward to the release of 6.10.5 :)
Just released :)
Most helpful comment
Just released :)