This repository was archived by the owner on Feb 12, 2024. It is now read-only.
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
error importing ipfs-core from TypeScript "Cannot find namespace 'fs'." #4080
Description
- Version: 0.14.2
-
Platform: Darwin MacBook-Pro.local 21.3.0 Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T8101 arm64
-
Subsystem:
-
ipfs-core package
- it's even possible that this is a quirk of how
npm publish
happens, since the error referencesnode_modules/ipfs-utils/dist/src/files/glob-source.d.ts
- it's even possible that this is a quirk of how
Severity: High (library not usable in this context)
Description:
- Here is a reduced test case running on gh actions: https://github.com/gobengo/ipfs-core-esm-test/runs/5951490366?check_suite_focus=true
Note: this issue is similar to #4029 , but a different ts error so not the same
Steps to reproduce the error:
- start a new typescript project
import * as IPFS from 'ipfs-core'
- try to
tsc build
- see error
bengo@MacBook-Pro ~/dev/ipld-experiments/ipld-web3-storage ⚡ npm run build
> ipld-web3-storage@1.0.0 build
> tsc
node_modules/ipfs-utils/dist/src/files/glob-source.d.ts:10:14 - error TS2503: Cannot find namespace 'fs'.
10 content: fs.ReadStream | undefined;
~~
Found 1 error in node_modules/ipfs-utils/dist/src/files/glob-source.d.ts:10
I tried clonging js-ipfs repo myself to npm link
and find a fix, but npm install
on my m1 mac fails because npm ERR! response status 404 Not Found on https://node-webrtc.s3.amazonaws.com/wrtc/v0.4.7/Release/darwin-arm64.tar.gz
which is node-webrtc/node-webrtc#680