-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Cannot find module '*' (SWC Compilation Error) #11891
Comments
Looks like your repository is private |
I can solve existing problem. But I am facing another issue. I already plaace a question on discussion into swc. Can you please see the question if you can please. |
Yes, I can solve it now. But I am seeing import issue. Could you please help on that? |
I already ask a question on swc GitHub discussion. Here is link-swc-project/swc#7577 |
@siamahnaf for that one, see #11863 |
I already see this issues. But I can't figure out? |
in src folder I have structure like-
I import user.entity into student.entity like -
I am getting an error like- I create a
and my
Where I am wrong? |
In In |
Hello, @kamilmysliwiec I update here is my tsconfig-
here is my nest-cli.json-
I do not create any Here is my project link-https://github.com/siamahnaf/swc-error Here is the error- I am on the |
Please provide a minimum reproduction repository (Git repository/StackBlitz/CodeSandbox project). |
I already provide my git repository in my last comment! |
But in my environment I am still seeing the error. I am trying from a windows pc Your environment? |
This is most likely an swc issue and not related to NestJS directly. @kamilmysliwiec correect meif I'm wrong here, but Nest doesn't do anything special to the config or resolution when using SWC, we just pass it directly to swc for transpilation, unlike with tsc how we hook into tsconfig-paths, correct? |
i try it but not work |
SWC won't work on web containers (stackblitz/codesandbox), just FYI.
In the latest version of |
Your highlighted issues all are closed as solve. But there is no proper solution. SWC said that they buy a windows pc and try to reproduce the issue. They don't find any issue, that's why they close the issue. But with nestjs we facing the same issue. |
It's a problem with swc on Windows. In unix environments or works as expected. If I had a Windows name I would try to figure out what swc configuration to change to get it to work |
Okay, thank you. Should I create a issue on SWC? |
I just double-checked and it seems to be working as expected (windows) @siamahnaf can you try to reproduce this issue with swc cli directly? |
@kamilmysliwiec |
Just to chime in on the discussion, I'm facing a similar issue with my project. When I turn off SWC, the module aliases seem to work perfectly, but the moment I switch it back on, everything falls apart. Here's my setup: nest-cli.json:
tsconfig.json:
Running
Which originates from this line in the compiled JS: const _profilemodule = require("@/profile/profile.module"); Disabling SWC and switching to tsc produces the correct path: const profile_module_1 = require("../profile/profile.module"); |
@onselakin can you please provide a minimum reproduction repository? |
Exactly same issue I am facing in my project. But it is working as expected in @kamilmysliwiec environment! I am now totally puzzled what's going on! Someone says this is the issue from swc(From Discord). @kamilmysliwiec, Should I create a new issue in |
@kamilmysliwiec , I have a question! I open a file from dist folder, that was already build. In the picture I can I see that-
SWC compile path like above. Why swc compile in this way where default typescript compiler compile like-
Why swc give the full path of the file when compilation? |
@siamahnaf I just ran into the same issue trying to build my project on Windows. It works on my Mac. |
same here |
I'm running it on Mac and got the same error, it's a problem on an .entity file too, I'm using MikroORM. |
I got the same issue |
Please, report this issue in the SWC repository https://github.com/swc-project/swc |
Is there an existing issue for this?
Current behavior
I am trying to update my existing project to nestjs 10 for using 20x fast compiler. I set my swc in
nest-cli.json
-And am I am getting a error like
Minimum reproduction code
https://github.com/siamahnaf/test-project
Steps to reproduce
No response
Expected behavior
I don't know what is the problem!
Package
@nestjs/common
@nestjs/core
@nestjs/microservices
@nestjs/platform-express
@nestjs/platform-fastify
@nestjs/platform-socket.io
@nestjs/platform-ws
@nestjs/testing
@nestjs/websockets
Other package
No response
NestJS version
No response
Packages versions
Node.js version
18.16.0
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: