-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 errors when shared lib is imported #883
Comments
Hi folks, I currently struggle with a similar problem. |
Facing same issue when referencing a code in cypress spec file from a lib folder. |
I'd like to mention, that when I move support code outside the support folder, the copy process completely messes up. Example:
Then the out-tsc will completely pull out the fixtures folder from the src folder and will look like this:
|
No feedback from the NX team :( |
For multiple apps reusing helpers, importing interfaces, etc. would be super helpful but basically everything causes the build to break. Is there anyone that could look into this? |
This is causing us a lot of pain, help!! |
Same problem here. Currently to me the inconvenience is that I can not use serialization functions of my custom data types. Not sure if this demand breaks the concept of e2e test: to simulate a totally ignorant user, IDK. Please help, or can someone give a clue about how the typescript compiler arrange out-tsc/ files, when there are shared library codes imported ? |
Same issue. |
this seems related to #1238 |
in #263 I shared my setup, I am using code from a lib within my cypress tests. I think in #1238 @diginikkari also has a solution (there is a repo linked within the issue), but notice in both solutions the path mappings do not work... |
Yep, I have been sharing models with cypress and also with firebase cloud functions in my nx-workspace, but only by using relative paths, which is not optimal. I think that now with custom builders support, I need to figure out how to make builder with using webpack for all apps in my workspace which are now using tsc. Problem is that because of angular I have been spoiled to not need to learn webpack before 😉 |
Hi all, thanks for your patience waiting for a response. I bring good news though. :) |
Hey, I have described how to use TypeScript type aliases in Cypress tests in this blog post: https://glebbahmutov.com/blog/using-ts-aliases-in-cypress-tests/ Hint: you need to configure both webpack and tsconfig |
Hey @bahmutov thanks for sharing this article. It's super awesome to see you popping into this repo to help out. 😍 I think this may help Jason out, but for the end user, it's pretty rare for us to alter the webpack config directly. I think (and I hope Jason agrees) we're all looking for Nx to solve this in a way that doesn't require us to eject from the Angular CLI. |
@bahmutov Can we simplify this for users by making a separate package under Here's my PoC: FrozenPandaz/demos@7f7ad57#diff-be5a146c9304da3c97d343c015bb4287R23 |
We are actually switching to Webpack internally soon cypress-io/cypress#4103 - this would simplify things. Handles js, ts, coffeescript, jsx/tsx, and scss |
That's absolutely fantastic! 🎉Let me try it locally. |
Works perfectly except it cannot resolve typescript paths. Left a comment to help address this cypress-io/cypress#4103 (comment). This is super exciting! |
Nevermind. Perhaps I misunderstood @bahmutov This is only for building |
@vsavkin @FrozenPandaz thank you so much <3 |
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. |
Importing from a shared lib into cypress e2e spec, breaks the build process with:
Reproduction steps
ng e2e
( everything is fine )ng e2e
( build is broken )Reproduction Repo
https://github.com/golfadas/farm
Angular & node versions
Angular CLI: 7.0.1
Node: 10.12.0
OS: darwin x64
Angular: 7.0.2
The text was updated successfully, but these errors were encountered: