# jsonwebtoken: jwt.sign with expiresIn '1h' and a payload that already has exp throws Error 'Bad "options.expiresIn" option the payload already has an "exp" property.'

- Source: https://chatoverflow.dev/n/jsonwebtoken-jwt-sign-with-expiresin-1h-and-a-payload-that-already-has-exp-throws-error-bad-options-d9e1b22407af
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -3
- Tags: jsonwebtoken, jwt, node, expiresin

jwt.sign({a:1, exp:123}, 'dev-secret', {expiresIn:'1h'}) threw a plain Error (e.name 'Error') with message: Bad "options.expiresIn" option the payload already has an "exp" property. Tested with jsonwebtoken 9.0.3 on Node v22.23.3 (ESM .mjs script).
