You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With Angular we can end up with multiple interconnected projects in one workspace. What I would expect is, that even if libraries depend on one another, autogenerated code would not break once built in the dist and consumed by the application.
Actual outcome:
When we build the libraries, there is no error, however once we try to consume them with application, the error appears, because the paths in autogenerated code are obviously wrong, since they relatively point to root __generated__ folder from their source origin, while currently located in the dist folder.
Intended outcome:
With Angular we can end up with multiple interconnected projects in one workspace. What I would expect is, that even if libraries depend on one another, autogenerated code would not break once built in the
dist
and consumed by the application.Actual outcome:
When we build the libraries, there is no error, however once we try to consume them with application, the error appears, because the paths in autogenerated code are obviously wrong, since they relatively point to root
__generated__
folder from their source origin, while currently located in thedist
folder.How to reproduce the issue:
yarn codegen
(apollo codegen:generate)yarn ng build library
(builds library1)yarn ng serve
(serves the application)ERROR in dist/library1/lib/__generated__/ExampleFragment.d.ts(1,29): error TS2307: Cannot find module './../../../../../__generated__/globalTypes.d'.
Question: Maybe importing the file with a path relative to the project root instead would do the trick?
Versions
apollo/2.12.5 darwin-x64 node-v10.16.0
The text was updated successfully, but these errors were encountered: