-
Notifications
You must be signed in to change notification settings - Fork 90
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
nest run fails if import dto in monorepo #34
Comments
Did you build the dto project? The types need to be emitted for them to be located.
… On Dec 24, 2019, at 2:03 PM, George Carpow ***@***.***> wrote:
Describe the bug
module.js:550
throw err;
^
Error: Cannot find module '/home/george/Documents/slovinar/server/dist/main'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Function.Module.runMain (module.js:694:10)
at startup (bootstrap_node.js:204:16)
at bootstrap_node.js:625:3
Expected behavior
Imported interface does not influence the build
To Reproduce
Repository URL: https://github.com/SlavDom/slovinar
Version
next.js: 9.1.9
nest: 6.7.2
nest-next: 9.1.1
Additional context
If I do not add a type from 'dto' folder, the run is successful, but if I add the import, it fails.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@kyle-mccarthy Yes, you're right. My fault. But one question, I run the application and the watcher gives the following feedback. Why does it try watching the const dir = resolve(__dirname, '../../ui');
const app = Next({ dev, dir });
|
Is that the correct relative path? It looks like it may be going up too many directories.
… On Dec 24, 2019, at 2:49 PM, George Carpow ***@***.***> wrote:
@kyle-mccarthy Yes, you're right. My fault.
But one question, I run the application and the watcher gives the following feedback. Why does it try watching the /home directory and not only ui folder that I defined in the following code?
const dir = resolve(__dirname, '../../ui');
const app = Next({ dev, dir });
Watchpack Error (watcher): Error: watch /home ENOSPC Watchpack Error (watcher): Error: watch /home/george ENOSPC
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@kyle-mccarthy yes, it is. and the same path is in the monorepo example here. |
Are you running it from the main project directory or the server directory? Sorry I am not in front of my computer so I can’t provide a ton of assurance at the moment!
… On Dec 24, 2019, at 3:59 PM, George Carpow ***@***.***> wrote:
@kyle-mccarthy yes, it is. and the same path is in the monorepo example here.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@kyle-mccarthy I run the app from server folder. |
When importing dtos in the ui project, you need to explicitly import from the "src" folder, as the example does. The reason is that Next doesn't compile TypeScript with the TypeScript compiler (that would otherwise take care of this), but it transpiles it with Babel instead. Also, you need to do "npm build" on both "ui" and "server" before starting from "server". No need to compile "dto", as the "server" build does this for you, while "ui" doesn't need it. The watch error is Linux specific and I only saw a similar one recently (like, two days ago) and have no idea what's causing it and how to solve it. All I can say for sure is that Windows can watch files in all repos normally through "npm dev" on the server. |
I was told (by the same colleague that showed me the aforementioned similar Linux issue) that the problem was the watcher limit was too low. A value of 16384 was sufficient for our project... Not sure if that value is needed also for the example. You can set it (permanently) with
|
I looked into this more and found some answers in the gatsby and jest repos that offer the same suggestion as @boenrobot, also it looks like just rebooting resolves the issue sometimes as well. Since this issue isn't really related to to nest-next I am going to close it. Here are the relevant discussions from the other repos. |
Describe the bug
module.js:550
throw err;
^
Error: Cannot find module '/home/george/Documents/slovinar/server/dist/main'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Function.Module.runMain (module.js:694:10)
at startup (bootstrap_node.js:204:16)
at bootstrap_node.js:625:3
Expected behavior
Imported interface does not influence the build
To Reproduce
Repository URL: https://github.com/SlavDom/slovinar
Version
Additional context
If I do not add a type from 'dto' folder, the run is successful, but if I add the import, it fails.
The text was updated successfully, but these errors were encountered: