You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bundle option breaks handler resolution in dev mode #6253
I use a custom build pipeline (tsdown/rolldown) instead of SST's built-in esbuild because my project includes native binaries that require special bundling treatment (externals, copy steps). The build outputs to a dist/ directory which I reference via the bundle option.
This works perfectly with sst deploy, but breaks in sst dev.
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
at Object.pathToFileURL (node:url:1024:3)
at .sst/platform/dist/nodejs-runtime/index.js:33:24
Cause
SST's dev mode nodejs-runtime tries to resolve the handler path using logic that expects source files relative to the project root. When bundle is provided, this resolution fails and returns undefined, which then crashes pathToFileURL().
Deploy mode works because it just zips the bundle directory without path resolution.
Activity
rafael-lua commentedon Feb 21, 2026
Just leaving a +1 here. I prefer in general have control of bundling pipeline and use other tools than esbuild (such as tsdown).
It was also confusing on what even was the issue, so I'm happy we have at least a workaround (ty @wujekbogdan ).
artem-simutin commentedon Apr 10, 2026
Same here, face the same issue by bundling Nest.js standalone application by using Webpack.
Dev: resolve a relative custom bundle path from the project root (#25)