tsdx
tsdx copied to clipboard
node-fetch related deps are not found when built
Current Behavior
I tried to create a little SDK using tsdx. I built the package and installed it on locally to test on React App. When i run the app it shows warning that:
warn - ../.../node_modules/node-fetch/lib/index.js
Module not found: Can't resolve 'encoding' in '/.../node_modules/node-fetch/lib'
../.../node_modules/ws/lib/buffer-util.js
Module not found: Can't resolve 'bufferutil' in '/.../node_modules/ws/lib'
../.../node_modules/ws/lib/validation.js
Module not found: Can't resolve 'utf-8-validate' in '/.../node_modules/ws/lib'
Expected behavior
No warning or module found.
Suggested solution(s)
N/A
Additional context
All the default configuration except isomorphic-unfetch added.
Your environment
System:
OS: macOS 12.5
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 5.77 GB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.10.0 - /usr/local/bin/node
Yarn: 1.22.15 - /usr/local/bin/yarn
npm: 8.10.0 - /usr/local/bin/npm
Watchman: 2021.09.13.00 - /usr/local/bin/watchman
Browsers:
Brave Browser: 104.1.42.88
Chrome: 104.0.5112.79
Firefox: 95.0.2
Safari: 15.6
npmPackages:
typescript: ^4.7.4 => 4.7.4