-
Notifications
You must be signed in to change notification settings - Fork 208
chore(deps): bump nodemailer from 7.0.11 to 8.0.5 #2781
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
Open
dependabot
wants to merge
1
commit into
main
Choose a base branch
from
dependabot/npm_and_yarn/nodemailer-8.0.5
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 The
@types/nodemailerpackage independenciesis still pinned to^7.0.4while this PR bumps the runtimenodemailerto^8.0.5— a major version mismatch. The fix is trivial: update@types/nodemailerto^8.0.0to match the installed runtime.Extended reasoning...
What the bug is and how it manifests
This PR bumps
nodemailerfrom^7.0.11to^8.0.5inpackage.json, but leaves@types/nodemailerat^7.0.4. Because semver ranges do not cross major version boundaries, the^7.0.4constraint will always resolve to a 7.x package and will never pick up the v8 type definitions. nodemailer v8 does not ship its own TypeScript types (notypesortypingsfield in itspackage.json), so the DefinitelyTyped package is the only source of types. The runtime is v8.0.5 while TypeScript compiles against v7.x definitions — a genuine major-version mismatch.The specific code path that triggers it
app/api/contact-sales/route.tsimports nodemailer and callsnodemailer.createTransport(smtpUrl)andtransporter.sendMail({from, to, replyTo, subject, text}). TypeScript resolves the types for these calls from the installed@types/nodemailerpackage, which will be 7.x rather than 8.x.Why existing code doesn't prevent it / addressing the refutation
The refuting verifier correctly points out that the only documented breaking change in nodemailer v8.0.0 is the runtime error-code rename
NoAuth→ENOAUTH, which is not a type-level change and is not referenced in the codebase. For the specific APIs currently in use (createTransportwith a string URL andsendMailwith standard mail options), the type signatures are functionally identical between v7 and v8, meaning no TypeScript compilation error is produced today.However, this does not make the mismatch non-existent — it makes it low-impact. Having the runtime at major version 8 and the type definitions at major version 7 is objectively incorrect. Any future code additions that use new v8-only APIs would silently use incorrect or missing type signatures, and the mismatch makes it harder to reason about the dependency graph. Dependency hygiene dictates that types packages track their corresponding runtime package's major version.
Impact
Current impact is low: no compile errors occur for the existing
createTransport/sendMailusage. The risk is latent — new code using v8-specific APIs or error codes would be type-checked against stale v7 definitions without any warning.How to fix it
In
package.json, update@types/nodemailerfrom^7.0.4to^8.0.0. Note that@types/nodemaileris currently placed independenciesrather thandevDependencies; this is a pre-existing placement issue and is separate from the version mismatch introduced by this PR.Step-by-step proof
nodemailerruntime is resolved to8.0.5(confirmed bypnpm-lock.yaml:nodemailer@8.0.5: {}).@types/nodemaileris constrained to^7.0.4— semver range resolves to latest 7.x (e.g., 7.0.11).@types/nodemailer@8.0.0exists on npm (confirmed by verifiers via registry check).typesfield in package.json), so TypeScript falls back to@types/nodemailer.^7.0.4constraint must be changed to^8.0.0to resolve correctly.