Title: [Bug]: @holoscript/engine .d.ts files omit file extensions on relative imports, breaking moduleResolution node16/nodenext · Issue #686 · brianonbased-dev/HoloScript · GitHub
Open Graph Title: [Bug]: @holoscript/engine .d.ts files omit file extensions on relative imports, breaking moduleResolution node16/nodenext · Issue #686 · brianonbased-dev/HoloScript
X Title: [Bug]: @holoscript/engine .d.ts files omit file extensions on relative imports, breaking moduleResolution node16/nodenext · Issue #686 · brianonbased-dev/HoloScript
Description: Bug Description @holoscript/engine declares "type": "module" and "engines": { "node": ">=20" }, so TypeScript treats its .d.ts files as ES modules. Under moduleResolution: "node16" or "nodenext", TypeScript requires explicit file extensi...
Open Graph Description: Bug Description @holoscript/engine declares "type": "module" and "engines": { "node": ">=20" }, so TypeScript treats its .d.ts files as ES modules. Under moduleResolution: "node16" or "nodenext", T...
X Description: Bug Description @holoscript/engine declares "type": "module" and "engines": { "node": ">=20" }, so TypeScript treats its .d.ts files as ES modul...
Opengraph URL: https://github.com/brianonbased-dev/HoloScript/issues/686
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: @holoscript/engine .d.ts files omit file extensions on relative imports, breaking moduleResolution node16/nodenext","articleBody":"### Bug Description\n\n`@holoscript/engine` declares `\"type\": \"module\"` and `\"engines\": { \"node\": \">=20\" }`, so TypeScript treats its `.d.ts` files as ES modules. Under `moduleResolution: \"node16\"` or `\"nodenext\"`, TypeScript requires explicit file extensions on relative imports in ES modules, as well as explicit `/index.js` paths on directory imports.\n\nThe published declaration files in `dist/` use extensionless file and directory paths, such as `dist/index.d.ts`, `dist/runtime/index.d.ts`, and `dist/ecs/index.d.ts`:\n\n```ts\nexport { SpatialEngine, ... } from './SpatialEngine';\nexport * from './rendering';\n```\n\nAs a result, `export *` re-exports (such as `BloomEffect` from `@holoscript/engine` or `HeadlessRuntime` from `@holoscript/engine/runtime`) fail to resolve with `TS2305`, and named re-exports (such as `SpatialEngine` or `World` from `@holoscript/engine/ecs`) resolve as `any`.\n\n### Steps to Reproduce\n\n1. In an empty directory, install `@holoscript/engine@6.1.9` and `typescript`:\n ```sh\n npm init -y\n npm i @holoscript/engine@6.1.9 typescript@5.9.3\n ```\n2. Save `tsconfig.json` and `repro.mts` from the Code Sample section below.\n3. Run `npx tsc -p .`.\n\n### Expected Behavior\n\n`tsc` resolves all exports and preserves their types under `moduleResolution: \"nodenext\"`, matching `moduleResolution: \"bundler\"` (where `BloomEffect` and `HeadlessRuntime` resolve, and assigning `SpatialEngine` or `new World()` to `symbol` reports `TS2322`).\n\n### Code Sample\n\n`tsconfig.json`:\n```json\n{\n \"compilerOptions\": {\n \"module\": \"nodenext\",\n \"moduleResolution\": \"nodenext\",\n \"strict\": true,\n \"noEmit\": true,\n \"skipLibCheck\": true\n },\n \"files\": [\"repro.mts\"]\n}\n```\n\n`repro.mts`:\n```ts\nimport { BloomEffect, SpatialEngine } from \"@holoscript/engine\";\nimport { HeadlessRuntime } from \"@holoscript/engine/runtime\";\nimport { World } from \"@holoscript/engine/ecs\";\n\nexport const probeEngine: symbol = SpatialEngine;\nexport const probeWorld: symbol = new World();\n```\n\n### HoloScript Version\n\n`@holoscript/engine@6.1.9` (also reproduced against `main` at `83412f8`)\n\n### Environment\n\nNode.js\n\n### Operating System\n\nLinux\n\n### Error Logs\n\n`npx tsc -p .` (same output on TypeScript 5.9.3 and 7.0.2):\n```text\nrepro.mts(1,10): error TS2305: Module '\"@holoscript/engine\"' has no exported member 'BloomEffect'.\nrepro.mts(2,10): error TS2305: Module '\"@holoscript/engine/runtime\"' has no exported member 'HeadlessRuntime'.\n```\n\n`probeEngine` and `probeWorld` do not report type errors because `SpatialEngine` and `World` become `any`. Under `\"module\": \"esnext\", \"moduleResolution\": \"bundler\"` (with `repro.ts`), `BloomEffect` and `HeadlessRuntime` resolve and `tsc` reports the expected type errors:\n```text\nrepro.ts(5,14): error TS2322: Type 'typeof SpatialEngine' is not assignable to type 'symbol'.\nrepro.ts(6,14): error TS2322: Type 'World' is not assignable to type 'symbol'.\n```\n\nWith `\"skipLibCheck\": false` under `nodenext`, `tsc` reports 85 `TS2834` errors across `node_modules/@holoscript/engine/dist/**/*.d.ts`:\n```text\nnode_modules/@holoscript/engine/dist/ecs/index.d.ts(1,85): error TS2834: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path.\n```\n\n### Additional Context\n\n`packages/engine/tsup.config.ts` sets `dts: false`, and `packages/engine/scripts/build.mjs` emits declarations via `tsc -p tsconfig.dts.json`, which extends `packages/engine/tsconfig.json` (`\"module\": \"ESNext\", \"moduleResolution\": \"bundler\"`). `tsc` keeps the extensionless file and directory specifiers from `packages/engine/src` verbatim in `dist/**/*.d.ts`. Using explicit `.js` and `/index.js` specifiers on relative imports/exports (which is also valid under `bundler`) resolves this.\n\nCredit: https://ucsbplse.github.io/\n","author":{"url":"https://github.com/trackoor","@type":"Person","name":"trackoor"},"datePublished":"2026-11-16T04:19:22Z","url":"https://github.com/brianonbased-dev/HoloScript/issues/686"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:af2673a7-079b-8a89-741c-d0ed07b0b88a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B7B6:20AA01:2C0DF68:37F71CE:6B019CB5 |
| html-safe-nonce | 5e82a90521069e0d713f34161835168f3d92f41953e9f526f553e0628c57324b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCN0I2OjIwQUEwMToyQzBERjY4OjM3RjcxQ0U6NkIwMTlDQjUiLCJ2aXNpdG9yX2lkIjoiODc3MDYwMTg3MzQxMDQ2NDk0OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 64dfe92ab82736aedbd01fd11eadc256ff02e0604c08b27fcfdde9d0526aaabf |
| hovercard-subject-tag | issue:6414081895 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/brianonbased-dev/HoloScript/686/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4f31aec876748f3690a329a02e7703aed54e9af36daaef5af524b9bf8a213286/brianonbased-dev/HoloScript/issues/686 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4f31aec876748f3690a329a02e7703aed54e9af36daaef5af524b9bf8a213286/brianonbased-dev/HoloScript/issues/686 |
| og:image:alt | Bug Description @holoscript/engine declares "type": "module" and "engines": { "node": ">=20" }, so TypeScript treats its .d.ts files as ES modules. Under moduleResolution: "node16" or "nodenext", T... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | trackoor |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/brianonbased-dev/HoloScript git https://github.com/brianonbased-dev/HoloScript.git |
| octolytics-dimension-user_id | 225674784 |
| octolytics-dimension-user_login | brianonbased-dev |
| octolytics-dimension-repository_id | 1134733067 |
| octolytics-dimension-repository_nwo | brianonbased-dev/HoloScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1134733067 |
| octolytics-dimension-repository_network_root_nwo | brianonbased-dev/HoloScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width