Describe the bug
The package @tsed/platform-http imports and uses the encodeurl library in PlatformResponse.ts, but encodeurl is not listed in the dependencies section of its package.json.
This causes build/test failures in strict environments (like Bun or pnpm) where "phantom dependencies" are not allowed, or when @tsed/platform-http is used without @tsed/platform-express (which usually hoists encodeurl).
References:
To Reproduce
To Reproduce
- Initialize a project using a strict package manager like Bun or pnpm.
- Install
@tsed/platform-http (ensure @tsed/platform-express is not installed, as it masks the issue by hoisting the dependency).
- Run any code or test that initializes
PlatformResponse.
- See error:
Error: Cannot find package 'encodeurl'
Expected behavior
@tsed/platform-http should be self-contained. When installed in isolation or in strict environments (like Bun or pnpm), it should correctly resolve its own internal imports without requiring the user to manually install transient dependencies like encodeurl.
Code snippets
Import in PlatformResponse.ts:
import encodeUrl from "encodeurl";
// ...
item = encodeUrl(String(item));
Resulting Error:
Error: Cannot find package 'encodeurl' imported from .../@tsed/platform-http/lib/esm/common/services/PlatformResponse.js
Repository URL example
https://github.com/tsedio/tsed/blob/production/packages/platform/platform-http/src/common/services/PlatformResponse.ts#L6
OS
macOS / Linux (CI)
Node version
v22.19.0
Library version
v8.24.0
Additional context
This issue was identified in a Bun monorepo. It was initially hidden locally because a previous installation of express had hoisted encodeurl into the global cache. After running bun pm cache clean and a fresh bun install, the error became consistently reproducible. This highlights that @tsed/platform-http currently relies on other packages (like platform-express) to accidentally provide its dependencies.
Describe the bug
The package
@tsed/platform-httpimports and uses theencodeurllibrary inPlatformResponse.ts, butencodeurlis not listed in the dependencies section of itspackage.json.This causes build/test failures in strict environments (like Bun or pnpm) where "phantom dependencies" are not allowed, or when
@tsed/platform-httpis used without@tsed/platform-express(which usually hoistsencodeurl).References:
PlatformResponse.ts(https://github.com/tsedio/tsed/blob/production/packages/platform/platform-http/src/common/services/PlatformResponse.ts#L6) imports it:import encodeUrl from "encodeurl";package.json(https://github.com/tsedio/tsed/blob/production/packages/platform/platform-http/package.json) does not list it.To Reproduce
To Reproduce
@tsed/platform-http(ensure@tsed/platform-expressis not installed, as it masks the issue by hoisting the dependency).PlatformResponse.Error: Cannot find package 'encodeurl'Expected behavior
@tsed/platform-httpshould be self-contained. When installed in isolation or in strict environments (like Bun or pnpm), it should correctly resolve its own internal imports without requiring the user to manually install transient dependencies likeencodeurl.Code snippets
Repository URL example
https://github.com/tsedio/tsed/blob/production/packages/platform/platform-http/src/common/services/PlatformResponse.ts#L6
OS
macOS / Linux (CI)
Node version
v22.19.0
Library version
v8.24.0
Additional context
This issue was identified in a Bun monorepo. It was initially hidden locally because a previous installation of
expresshad hoistedencodeurlinto the global cache. After runningbun pm cache cleanand a freshbun install, the error became consistently reproducible. This highlights that@tsed/platform-httpcurrently relies on other packages (likeplatform-express) to accidentally provide its dependencies.