Agoric / agoric-sdk

monorepo for the Agoric Javascript smart contract platform
Apache License 2.0
327 stars 208 forks source link

.js extension missing in imports from orchestration types files #10143

Closed dckc closed 1 month ago

dckc commented 1 month ago

Describe the bug

The .js extension is missing from a couple imports:

https://github.com/Agoric/agoric-sdk/blob/f46aec96c6aa69bab926c682dbdd37845b3a5618/packages/orchestration/src/exos/exo-interfaces.ts#L4-L5

To Reproduce

Steps to reproduce the behavior:

  1. yarn set version berry; yarn add @agoric/orchestration to get 0.2.0-u17.1
  2. set up typescript yarn add --dev typescript; copy .yarnrc.yml and tsconfig.json from dapp-orchestration-basics
  3. put import { withOrchestration } from '@agoric/orchestration/src/utils/start-helper.js'; in src/x.js
  4. yarn tsc
  5. blammo:
$ yarn tsc
node_modules/@agoric/orchestration/src/exos/exo-interfaces.ts:4:44 - error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean '../utils/address.js'?

4 import type { ICAChannelAddressOpts } from '../utils/address';
                                             ~~~~~~~~~~~~~~~~~~

node_modules/@agoric/orchestration/src/exos/exo-interfaces.ts:5:36 - error TS2835: Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './icq-connection-kit.js'?

5 import type { ICQConnection } from './icq-connection-kit';
                                     ~~~~~~~~~~~~~~~~~~~~~~

Found 2 errors in the same file, starting at: node_modules/@agoric/orchestration/src/exos/exo-interfaces.ts:4

Expected behavior

Platform Environment

Additional context

working on

dckc commented 1 month ago

I used yarn patch to make a work-around:

https://github.com/Agoric/dapp-orchestration-basics/pull/49/commits/0699e47b26fb131401d6668d2714a3cbd7ecc69c