Skip to content

fix(express,cloudflare): move @atxp/server to peerDependencies#142

Closed
emilioacc wants to merge 1 commit intomainfrom
fix/server-peer-dep
Closed

fix(express,cloudflare): move @atxp/server to peerDependencies#142
emilioacc wants to merge 1 commit intomainfrom
fix/server-peer-dep

Conversation

@emilioacc
Copy link
Contributor

Problem

@atxp/express bundles @atxp/server as a regular dependency. When a consumer also depends on @atxp/server directly, npm installs two copies with separate module-level state — the ATXP context set by express is invisible to the consumer's imports.

Fix

Move @atxp/server from dependencies to peerDependencies in @atxp/express and @atxp/cloudflare. Bump both to 0.10.8.

Migration

Consumers need to add @atxp/server as a direct dependency:

npm install @atxp/server@^0.10.7

Linear-issue: ATXP-1712

Move @atxp/server from dependencies to peerDependencies in both
@atxp/express and @atxp/cloudflare. This prevents duplicate instances
of @atxp/server when consumers also depend on it directly.

The previous design bundled @atxp/server as a regular dependency, which
meant npm would install a nested copy if the consumer had a different
version. Since @atxp/server uses module-level state for ATXP context
(account ID, token, config), two copies means the context set up by
express middleware is invisible to the consumer's code — causing
'Authenticated user is required' errors.

With peerDependencies, npm installs a single shared copy, and the
consumer controls the version.

Bump @atxp/express and @atxp/cloudflare to 0.10.8.

Linear-issue: ATXP-1712
@emilioacc
Copy link
Contributor Author

Closing — moving to peerDependencies would break existing consumers. Will implement getBalance locally in the image service instead.

@emilioacc emilioacc closed this Mar 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant