fix: esm-only compatibility support issue #9#10
Open
robertsoniv wants to merge 1 commit into
Open
Conversation
pbarrenechea
previously approved these changes
Oct 23, 2025
sc-nikolaoslazaridis
previously approved these changes
Oct 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 Description
This PR addresses the ESM/CommonJS compatibility issue in Sitecore Cloud-SDK packages that prevents their use in modern JavaScript frameworks and ESM-only projects. The changes ensure all packages work seamlessly in both ESM and CommonJS environments while maintaining backward compatibility.
Key Changes:
import/requireconditions for all packages"type": "module"to all package.json files to properly declare ESM support'use strict';statements from ESM wrapper filesTechnical Implementation:
exportsfield in package.json to use proper conditional export syntaxThis fix resolves module resolution errors like
Cannot find module '@sitecore-cloudsdk/events/browser'that occur in projects with"type": "module"in package.json, enabling adoption in modern frameworks like TanStack Start, Vite, and Next.js App Router.🔍 Related issues
Fixes #[9] - ESM/CommonJS Compatibility Issue - Packages Fail in ESM-Only Projects
📦Affected Packages