Skip to content

Fix TypeScript compilation error for import.meta in tests#37

Closed
Copilot wants to merge 3 commits intomainfrom
copilot/fix-build-error-ts-import-meta
Closed

Fix TypeScript compilation error for import.meta in tests#37
Copilot wants to merge 3 commits intomainfrom
copilot/fix-build-error-ts-import-meta

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 16, 2026

Tests fail to compile when using import.meta.url because the main tsconfig.json specifies "module": "commonjs", which doesn't support the import.meta meta-property.

// test/git.test.ts:9
const __filename = fileURLToPath(import.meta.url);  // TS1343 error

Changes

  • Created tsconfig.test.json extending main config with "module": "node16" to support ES module features in tests
  • Updated test script to use TS_NODE_PROJECT=tsconfig.test.json

This allows tests to use import.meta while keeping the main build configuration as CommonJS. The node16 module mode supports dual CommonJS/ESM environments and correctly handles import.meta in TypeScript compilation.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.openai.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/loz/loz/node_modules/.bin/mocha -r ts-node/register src/history/test.ts src/llm/test.ts src/prompt/test.ts test/**/*test.ts (dns block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node dist Get the current date and time on this system (dns block)
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node dist Check available memory on this Linux (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 16, 2026 21:43
…onfig

Co-authored-by: joone <1979160+joone@users.noreply.github.com>
Co-authored-by: joone <1979160+joone@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix build error related to import.meta in tests Fix TypeScript compilation error for import.meta in tests Feb 16, 2026
Copilot AI requested a review from joone February 16, 2026 21:48
@joone joone closed this Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants