-
Notifications
You must be signed in to change notification settings - Fork 275
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
NextJs template not building with Yarn #1789
Comments
@SLTKA seems like this is related to a previously reported issue. Please refer to the last comment to work around this. |
Hi @sc-addypathania thank you for the link. I'm not sure how this helps with One obvious solution would be to use Below is just an opinion please don't read it as any guidance or desire for action: Consumer (the sample projects) of packages need to ensure that they install all peer dependencies. Other dependencies should be TRULY optional and should not cause any issue (which is not the case now). On the other hand, peer dependencies can be still required (not optional), so possibly you need to consider including what is not optional into In summary, The other way is to ignore people preferences on package manager and to clearly document that other (not |
@SLTKA I understand your concern now. I have added this to our backlog, we will soon make a decision on how to handle this issue with yarn. |
Describe the Bug
When using YARN instead of NPM on freshly created NextJS template (using create-sitecore-jss) it fails to build due to missing dependencies. Tested with 21.7.1.
missing modules
@sitecore-feaas/clientside
and othersTo Reproduce
run
npx create-sitecore-jss@21.7.1 nextjs
remove package-lock file
run
yarn
using yarn v1.22.xrun
yarn start:connected
Expected Behavior
Yarn 1.x doesn't handle peerDependencies on imported packages and require them to be listed as dev or normal dependencies yarnpkg/yarn#1503
NextJS Template should explicitly install all Peer Dependencies (as it was before in 21.6.3) OR all peerDependencies should be optional and not use
require
in bundled code. At the same time version of deps should beshould be lenient.
(https://nodejs.org/en/blog/npm/peer-dependencies).Possible Fix
No response
Provide environment information
The text was updated successfully, but these errors were encountered: