Fix circular ESM dependency in base-action while restoring CHECK_USER_ACCESS extensibility#793
Merged
surajair merged 3 commits intocheck_user_access_actionfrom Mar 4, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: surajair <9153560+surajair@users.noreply.github.com>
Deploying sdk with
|
| Latest commit: |
b5d3c70
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c9989fa5.sdk-8n4.pages.dev |
| Branch Preview URL: | https://copilot-sub-pr-792.sdk-8n4.pages.dev |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
sdk-nextjs | b5d3c70 | Mar 04 2026, 05:46 PM |
Copilot
AI
changed the title
[WIP] Update to address feedback on moving getUserAccess method
Fix circular module dependency in base-action via standalone getUserAccess helper
Mar 4, 2026
Co-authored-by: surajair <9153560+surajair@users.noreply.github.com>
Copilot
AI
changed the title
Fix circular module dependency in base-action via standalone getUserAccess helper
Fix circular ESM dependency in base-action while restoring CHECK_USER_ACCESS extensibility
Mar 4, 2026
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.
The previous fix for the circular module dependency (
base-action→actions-registery→check-user-access→base-action) broke extensibility: callinggetUserAccess()directly bypassed the registry, preventing users from overridingCHECK_USER_ACCESSwith a custom action.Changes
base-action.ts: Replace staticgetUserAccessimport with a dynamicimport()insideverifyAccess(). The deferred import resolves after all modules are initialized, eliminating the circular init issue while keeping the registry delegation intact.base-action.ts: Throw an explicitActionError(ACCESS_CHECK_NOT_FOUND) ifCHECK_USER_ACCESSis missing from the registry instead of silently bypassing the check.get-user-access.ts: Retained as a standalone helper used byCheckUserAccessActiondirectly.Users can still override the default access check by registering a custom action:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.