-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Fix version mismatch error #1180
Conversation
For information, here are some alternatives to Parcel, but they seem to have the same issue: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed I reproduce this issue too.
Your updates are breaking the typescript build on dates-components and markdown-components (if you build after erasing/reinstalling your node_modules in those packages and in the frontend folder), so we can't do that.
These dev dependencies are required by Typescript for typing correctly the packages, and I can find an easy solution to ignore that. I tested parcel alias but it doesn't work, and I tested to install these dev dependencies in the frontend folder instead of each package folder, but it doesn't seem to solve the problem :/
It seems it's an issue with how yarn link is working and it can be mitigated by using yalc instead of yarn link :
yarn global add yalc
# In semapps/markdown-components folder (on "next" branch for example)
yalc publish
# In app using semapps
yalc link @semapps/markdown-components
# In semapps/markdown-components folder whenever you make changes
yarn build && yalc publish --push
Can you confirm this solution works for you too? Can it be an acceptable solution?
Thanks for the investigation and the proposal @mguihal |
@mguihal your solution works for me. |
Closing this PR in favor of #1181 See you there for the following discussions :-) |
Since
devDependencies
were added to the@semapps/date-components
and@semapps/markdown-components
, usingyarn link
with these packages produce many problems:You are loading @emotion/react when it is already loaded. Running multiple instances may cause problems. This can happen if multiple versions are used, or if multiple builds of the same version are used.
@Laurin-W could reproduce this as well.
After more than 2 hours of search, here are the most significant issues:
react
&react-dom
are dev dependencies jaredpalmer/tsdx#64.The last issue indicate that the problem appears when React (and probably MUI) are in dev dependencies.
So I removed all the devDependencies from
@semapps/date-components
and@semapps/markdown-components
(except parcel) in this PR and it's now working fine.@mguihal @Laurin-W Can we do without these devDependencies ? What problems does it cause, except maybe eslint warnings ?
Two other solutions:
Add a reverse link to the
react
(and other packages), as noted in the two issues above. But this is very complicated to setup, because it must be changed whenever we work on another app. Plus it doesn't work if we work simultaneously on two apps (this happened for me).Revert to the pre-Parcel config (as in v0.5). But there was many problems. And I don't really know why it worked, the risk is that this problems appears again.