Reference to non-existent js file from ts
dao opened this issue · 4 comments
Describe the bug
In https://github.com/multiformats/js-multiaddr/blob/master/src/convert.ts I see:
import { getProtocol } from './protocols-table.js'
Stepping out to the directory view, there is no protocols-table.js
. There is, however, protocols-table.ts
.
This is because the build tool (aegir) transpiles ESM from TS when the build is generated, (in the ./dist
folder) and relative import paths need full extensions (e.g we have to write import "./foo.js"
instead of import "./foo"
). You can see a similar example here or here
For more info see: https://www.typescriptlang.org/docs/handbook/esm-node.html
@dao I think this is functioning as expected. Are you seeing an error message or stack trace? If you are, can you please share the stack trace or repro repo.
Closing due to lack of response. Please reopen if you can provide the requested information.