Summary
Published @nktkas/hyperliquid (0.33.0, 0.33.1) ships its .d.ts files with a triple-slash directive hardcoding an absolute build-machine path:
/// <amd-module name="file:///home/runner/work/hyperliquid/hyperliquid/src/mod.ts" />
This appears in ~220 .d.ts files (entry esm/mod.d.ts names src/mod.ts). It's an artifact of the Deno→npm (dnt) build.
Impact
Any CommonJS build tool that derives the require() target from the amd-module name emits the absolute path into its .cjs output:
const hyperliquid_1 = require("file:///home/runner/work/hyperliquid/hyperliquid/src/mod.ts");
That path exists on no consumer machine, so CJS/bundler/Jest loads throw Cannot find module. ESM is unaffected. Consumers currently have to patch the shipped .d.ts to strip the directive.
Reproduce
- Install
@nktkas/hyperliquid@0.33.1.
grep -rl "amd-module" node_modules/@nktkas/hyperliquid → ~220 files with the file:///home/runner/... path.
- Build a CJS consumer with a tool that honors
amd-module → the absolute path leaks into require().
Suggested fix
Strip (or don't emit) the amd-module directives in the dnt build so .d.ts files don't carry the build machine's absolute path. Last version without them was 0.32.2.
Summary
Published
@nktkas/hyperliquid(0.33.0, 0.33.1) ships its.d.tsfiles with a triple-slash directive hardcoding an absolute build-machine path:/// <amd-module name="file:///home/runner/work/hyperliquid/hyperliquid/src/mod.ts" />This appears in ~220
.d.tsfiles (entryesm/mod.d.tsnamessrc/mod.ts). It's an artifact of the Deno→npm (dnt) build.Impact
Any CommonJS build tool that derives the
require()target from theamd-modulename emits the absolute path into its.cjsoutput:That path exists on no consumer machine, so CJS/bundler/Jest loads throw
Cannot find module. ESM is unaffected. Consumers currently have to patch the shipped.d.tsto strip the directive.Reproduce
@nktkas/hyperliquid@0.33.1.grep -rl "amd-module" node_modules/@nktkas/hyperliquid→ ~220 files with thefile:///home/runner/...path.amd-module→ the absolute path leaks intorequire().Suggested fix
Strip (or don't emit) the
amd-moduledirectives in thedntbuild so.d.tsfiles don't carry the build machine's absolute path. Last version without them was 0.32.2.