Skip to content

fix: declare @nrfcloud/validate-with-typebox as a runtime dependency - #71

Merged
coderbyheart merged 1 commit into
mainfrom
fix/problem-detail-1.4.4
Aug 5, 2026
Merged

fix: declare @nrfcloud/validate-with-typebox as a runtime dependency#71
coderbyheart merged 1 commit into
mainfrom
fix/problem-detail-1.4.4

Conversation

@coderbyheart

@coderbyheart coderbyheart commented Aug 5, 2026

Copy link
Copy Markdown
Member

Declares @nrfcloud/validate-with-typebox as a runtime dependency, and bumps
@nrfcloud/problem-detail to 1.4.4.

The bug

problemResponse.ts, validateInput.ts and validateResponse.ts all import
@nrfcloud/validate-with-typebox, but it was declared as a devDependency.
So the published package does not pull it in, and consumers that do not
independently have it in their tree fail at import time:

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@nrfcloud/validate-with-typebox'
  imported from …/node_modules/@nrfcloud/lambda-helpers/npm/problemResponse.js

This did not surface on JSR. JSR's NPM compatibility build derives the dependency
list from the actual imports, so it published
@jsr/nrfcloud__validate-with-typebox as a runtime dependency no matter how it
was declared here — you can still see it in the published
@jsr/nrfcloud__lambda-helpers@1.0.28
metadata. The NPM build publishes the declared dependencies verbatim, so the
mis-declaration became a real defect in 1.0.29.

How it was found

account-service-next builds its Lambda layers from an explicit subset of
dependencies. Its cognitoAuthLayer lists @nrfcloud/lambda-helpers but not
@nrfcloud/validate-with-typebox, so the authorizer Lambdas could not resolve
it, failed to initialise, and API Gateway answered every authorized request with
AuthorizerConfigurationException — a 500 that surfaced as a failing BDD test.

I audited all six of the migrated libraries for the same class of problem; this
is the only one affected.

Verified locally

The type check, tests and build pass, and npm ci reinstalls from the
regenerated lock file. Reproducing the cognitoAuthLayer build with this
version installs @nrfcloud/validate-with-typebox transitively, and an
authorizer-style ESM import of @nrfcloud/lambda-helpers against that layer
succeeds.

1.4.4 is the current release. The previous pin, 1.4.3, was the latest at the
time the dependency was switched from JSR to NPM, and was superseded before that
change was released.
@coderbyheart
coderbyheart requested a review from a team as a code owner August 5, 2026 13:46
@coderbyheart coderbyheart added the non-significant Non-significant changes that do not need a PR review label Aug 5, 2026
@coderbyheart
coderbyheart merged commit e0c3912 into main Aug 5, 2026
2 checks passed
@coderbyheart
coderbyheart deleted the fix/problem-detail-1.4.4 branch August 5, 2026 13:50
@coderbyheart

Copy link
Copy Markdown
Member Author

Non-significant change, no PR review required.

@coderbyheart coderbyheart changed the title fix: use @nrfcloud/problem-detail@1.4.4 fix: declare @nrfcloud/validate-with-typebox as a runtime dependency Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

non-significant Non-significant changes that do not need a PR review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant