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

Cypress builder should transform tsconfig paths #1238

Closed
diginikkari opened this issue Apr 8, 2019 · 5 comments
Closed

Cypress builder should transform tsconfig paths #1238

diginikkari opened this issue Apr 8, 2019 · 5 comments
Assignees

Comments

@diginikkari
Copy link
Contributor

Expected Behavior

I expect that modules which are imported using path aliases in tsconfig.json would be transformed to relative paths or e.g. webpack modules.

Current Behavior

If I import module using path alias e.g.

import { ProductType} from '@project/models'

This import is not transformed by tsc and it's still found in compiled js and I get "Error: Cannot find module '@project/models'" -error.

Failure Information (for bugs)

This is know limitation with tsc. Perhaps cypress builder could use webpack which handles tsconfig paths correctly.

@matt328
Copy link

matt328 commented Apr 9, 2019

My team currently has a need for this as well. Maybe something like https://www.npmjs.com/package/tsconfig-paths could accomplish the same thing without the additional overhead of a bundler like webpack?

@vsavkin
Copy link
Member

vsavkin commented Apr 14, 2019

@diginikkari could you provide a repro?

@vsavkin vsavkin self-assigned this Apr 14, 2019
diginikkari added a commit to diginikkari/repro-for-issue1238 that referenced this issue Apr 15, 2019
this is to repro: nrwl/nx#1238
@diginikkari
Copy link
Contributor Author

@vsavkin of course, here is repro repository: https://github.com/diginikkari/repro-for-issue1238

I tried to make it as clean as I could. It's just basic nx workspace with one app and one lib. tsconfig.e2e.json is modified to include lib module and changed outDir, because of that.

app.spec.ts is now failing, because imported module is not found. Hope this helps.

@FrozenPandaz
Copy link
Collaborator

Closing this as a duplicate of #883

Please go there for updates regarding this issue.

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants