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

JSS package incompatability with older versions #1477

Closed
mattyindustries opened this issue May 12, 2023 · 4 comments · Fixed by #1478
Closed

JSS package incompatability with older versions #1477

mattyindustries opened this issue May 12, 2023 · 4 comments · Fixed by #1478
Labels

Comments

@mattyindustries
Copy link

mattyindustries commented May 12, 2023

Describe the Bug

I'm working on a Next.JS Sitecore project that I'm wanting to target 21.0.8 as we don't have the time nor inclination right now to investigate the switch from Next.JS 12 to Next.JS 13.

Because of the way YARN/NPM handle versioning within the package.json files the syntax

"@sitecore-jss/sitecore-jss-nextjs": "^21.0.8",

This is currently valid for 21.0.8, 21.1.0, 21.1.1 and 21.1.2.

This flows through all of the sub packages as well and we keep getting Next.JS 13 compatible packages which is breaking our build.

I've no problem with your versioning strategy however I think you should go through your package.json's and update them to

"@sitecore-jss/sitecore-jss-nextjs": "~21.0.8",

which won't cross the minor version boundary.

To Reproduce

Establish a new Sitecore Next.JS site with version 21.0.8

npx [email protected] --templates nextjs,nextjs-sxa --appName testing--destination . --fetchWith GraphQL --prerender SSG --hostName www.testing.localhost

Perform a yarn install and build

Look in node_modules or yarn.lock to see version 21.1.2

  "name": "@sitecore-jss/sitecore-jss-nextjs",
  "version": "21.1.2",
  "main": "dist/cjs/index.js",
  "module": "dist/esm/index.js",

Expected Behavior

Sitecore packages remain compatible and don't introduce a breaking change or new functionality not desired.

Possible Fix

Update package.json files to use the ~ rather than the ^

Provide environment information

  • Sitecore Version: 10.3
  • JSS Version: 21
  • Browser Name and version: Chrome
  • Operating System and version (desktop or mobile): Windows
  • Link to your project (if available): N/A
@ambrauer
Copy link
Contributor

Thanks for the information, we've added this to our backlog to investigate / fix in an upcoming release.

@addy-pathania addy-pathania linked a pull request May 12, 2023 that will close this issue
7 tasks
@addy-pathania addy-pathania linked a pull request May 12, 2023 that will close this issue
7 tasks
@mattyindustries
Copy link
Author

Thanks @ambrauer . Awesome work

@mattyindustries
Copy link
Author

Thanks very much for releasing 21.0.9 which backports these changes.

Very appreciated.

@addy-pathania
Copy link
Contributor

@mattyindustries there was another correction so it should be 21.0.10 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants