Skip to content
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

Import aliases #20

Closed
afonsomatos opened this issue Nov 18, 2021 · 6 comments
Closed

Import aliases #20

afonsomatos opened this issue Nov 18, 2021 · 6 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed

Comments

@afonsomatos
Copy link

PS C:\Users\afons\Desktop\vettted> yarn nestia sdk ".\src\backend\controllers" --out ".\src\xapi"
yarn run v1.22.15
$ C:\Users\afons\Desktop\vettted\node_modules\.bin\nestia sdk .\src\backend\controllers --out .\src\xapi
src/backend/controllers/category.controller.ts:2:51 - error TS2307: Cannot find module '@/backend/services/category.service' or its corresponding type declarations.

2 import { CategoryService, ICategoryService } from "@/backend/services/category.service";
                                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@samchon samchon self-assigned this Nov 19, 2021
@samchon samchon added the bug Something isn't working label Nov 19, 2021
samchon added a commit that referenced this issue Nov 19, 2021
@samchon samchon added wontfix This will not be worked on invalid This doesn't seem right and removed bug Something isn't working labels Nov 19, 2021
@samchon
Copy link
Owner

samchon commented Nov 19, 2021

Looking at the new commit, there's no problem for the such alias imports.

To utilize the alias imports without error, run the nestia sdk command on a directory who've containing the tsconfig.json. Or run the nestia sdk command with newly configured nestia.config.json file with compilerOptions variable. I've prepared new examples for you. Read one of the below link, the you may understand how:

@hmmhmmhm
Copy link

hmmhmmhm commented Apr 9, 2022

@samchon The same error occurs based on the latest nest. I cannot configure any form of absolute path. I specified it in tsconfig.json, and I specified it in nestia.config.ts, and it's the same.

@hmmhmmhm
Copy link

hmmhmmhm commented Apr 9, 2022

I provide you with a reproducible sample. nest operation works well, but if you type npx nestia sdk in your project, you will encounter problems.

@samchon samchon added bug Something isn't working enhancement New feature or request help wanted Extra attention is needed and removed invalid This doesn't seem right wontfix This will not be worked on labels Apr 10, 2022
@samchon
Copy link
Owner

samchon commented Apr 10, 2022

I may found a way to solve the problem. It is wrote on the #27

@afonsomatos and @hmmhmmhm, I'll try to solve this bug within 2 weeks. If you can't wait that time, you'd better not to use the alias feature of the tsconfig.json

samchon added a commit that referenced this issue Apr 11, 2022
@samchon samchon mentioned this issue Apr 11, 2022
Merged
@samchon
Copy link
Owner

samchon commented Apr 11, 2022

@afonsomatos and @hmmhmmhm

Have fixed. Install the nestia v2.0 version and test it. All may be fine.

@samchon
Copy link
Owner

samchon commented Apr 14, 2022

@afonsomatos, @hmmhmmhm

I'm sorry for such late update.

It was so difficult to fixing this bug, but from now on, any project would be failed by the alias paths.

It's the v2.0.8 update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants