[bun] No matching export in "node_modules/node-fetch-native/dist/proxy.cjs"
Closed this issue ยท 6 comments
Bun: 1.0.25
Git repo: https://github.com/tkjaergaard/giget-bun-reproduction
Steps to reproduce
- Clone repository
- Install Bun version 1.0.25 (https://bun.sh)
- Run
bun install
to install dependencies - Run build command
$ bun build index.ts --outdir=dist --target=node
Error
11 | import { fetch } from 'node-fetch-native/proxy';
^
error: No matching export in "node_modules/node-fetch-native/dist/proxy.cjs" for import "fetch"
at /Users/thomaskjaergaard/projects/internal/giget-bun-reproduction/node_modules/giget/dist/index.mjs:11:10
Originally posted by @tkjaergaard in #140 (comment)
If i set the build target to browser
it works. But if i set it to bun
or node
i get the error.
When running the script using bun index.ts
, i don't see the error either ๐ค
Also if i use import { fetch } from 'node-fetch-native/proxy'
installed as a dependency i see the error.
Seems to more of an error with node-fetch-native/proxy
than giget?
I've added an example of using node-fetch-native directly in the reproduction repo: fetch-native-proxy.ts
@pi0 any progress on this? ๐
@pi0 All good, just interested in where this was stranded ๐ช
@pi0 I've identified the issue. It's related to unjs/node-fetch-native.
I've re-created the issue here: unjs/node-fetch-native#114.
@pi0 Think this should be closed since we fixed it in unjs/node-fetch-native#114 ๐โ๏ธ