I am trying to install the ts client into a brand new React app. I followed these steps:
npx create-react-app react-app
cd react-app
npm install weaviate-ts-client
npm start
And I get a bunch of 'Module not found' errors.
warning "weaviate-ts-client > [email protected]" has unmet peer dependency "graphql@14 - 16".
warning "weaviate-ts-client > graphql-request > @graphql-typed-document-node/[email protected]" has unmet peer dependency "graphql@^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0".
Module not found: Error: Can't resolve 'buffer' in '/Users/LGoolsby/dev/playground/searchv2/react-app/node_modules/safe-buffer'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "buffer": require.resolve("buffer/") }'
- install 'buffer'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "buffer": false }
WARNING in [eslint]
src/App.js
Line 1:8: 'logo' is defined but never used no-unused-vars
ERROR in ./node_modules/safe-buffer/index.js 3:13-30
Module not found: Error: Can't resolve 'buffer' in '/Users/LGoolsby/dev/playground/searchv2/react-app/node_modules/safe-buffer'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "buffer": require.resolve("buffer/") }'
- install 'buffer'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "buffer": false }
ERROR in ./node_modules/weaviate-ts-client/dist/index.js 46:9-26
Module not found: Error: Can't resolve 'stream' in '/Users/LGoolsby/dev/playground/searchv2/react-app/node_modules/weaviate-ts-client/dist'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "stream": require.resolve("stream-browserify") }'
- install 'stream-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "stream": false }
ERROR in ./node_modules/weaviate-ts-client/dist/index.js 356:11-36
Module not found: Error: Can't resolve 'zlib' in '/Users/LGoolsby/dev/playground/searchv2/react-app/node_modules/weaviate-ts-client/dist'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "zlib": require.resolve("browserify-zlib") }'
- install 'browserify-zlib'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "zlib": false }
ERROR in ./node_modules/weaviate-ts-client/dist/index.js 750:11-28
Module not found: Error: Can't resolve 'assert' in '/Users/LGoolsby/dev/playground/searchv2/react-app/node_modules/weaviate-ts-client/dist'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "assert": require.resolve("assert/") }'
- install 'assert'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "assert": false }
ERROR in ./node_modules/weaviate-ts-client/dist/index.js 751:9-33
Module not found: Error: Can't resolve 'buffer' in '/Users/LGoolsby/dev/playground/searchv2/react-app/node_modules/weaviate-ts-client/dist'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "buffer": require.resolve("buffer/") }'
- install 'buffer'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "buffer": false }
ERROR in ./node_modules/weaviate-ts-client/dist/index.js 1034:9-30
Module not found: Error: Can't resolve 'path' in '/Users/LGoolsby/dev/playground/searchv2/react-app/node_modules/weaviate-ts-client/dist'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }
ERROR in ./node_modules/weaviate-ts-client/dist/index.js 1235:9-22
Module not found: Error: Can't resolve 'fs' in '/Users/LGoolsby/dev/playground/searchv2/react-app/node_modules/weaviate-ts-client/dist'
ERROR in ./node_modules/weaviate-ts-client/dist/index.js 2391:8-26
Module not found: Error: Can't resolve 'process' in '/Users/LGoolsby/dev/playground/searchv2/react-app/node_modules/weaviate-ts-client/dist'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "process": require.resolve("process/browser") }'
- install 'process'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "process": false }
ERROR in ./node_modules/weaviate-ts-client/dist/index.js 2873:8-23
Module not found: Error: Can't resolve 'util' in '/Users/LGoolsby/dev/playground/searchv2/react-app/node_modules/weaviate-ts-client/dist'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "util": require.resolve("util/") }'
- install 'util'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "util": false }
ERROR in ./node_modules/weaviate-ts-client/dist/index.js 3398:9-26
Module not found: Error: Can't resolve 'crypto' in '/Users/LGoolsby/dev/playground/searchv2/react-app/node_modules/weaviate-ts-client/dist'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "crypto": require.resolve("crypto-browserify") }'
- install 'crypto-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "crypto": false }
ERROR in ./node_modules/weaviate-ts-client/dist/index.js 5955:7-23
Module not found: Error: Can't resolve 'https' in '/Users/LGoolsby/dev/playground/searchv2/react-app/node_modules/weaviate-ts-client/dist'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "https": require.resolve("https-browserify") }'
- install 'https-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "https": false }
ERROR in ./node_modules/weaviate-ts-client/dist/index.js 5956:10-24
Module not found: Error: Can't resolve 'net' in '/Users/LGoolsby/dev/playground/searchv2/react-app/node_modules/weaviate-ts-client/dist'
ERROR in ./node_modules/weaviate-ts-client/dist/index.js 5957:7-31
Module not found: Error: Can't resolve 'child_process' in '/Users/LGoolsby/dev/playground/searchv2/react-app/node_modules/weaviate-ts-client/dist'
ERROR in ./node_modules/weaviate-ts-client/dist/index.js 5958:7-28
Module not found: Error: Can't resolve 'path/posix' in '/Users/LGoolsby/dev/playground/searchv2/react-app/node_modules/weaviate-ts-client/dist'
ERROR in ./node_modules/weaviate-ts-client/dist/index.js 5959:7-20
Module not found: Error: Can't resolve 'os' in '/Users/LGoolsby/dev/playground/searchv2/react-app/node_modules/weaviate-ts-client/dist'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback 'resolve.fallback: { "os": require.resolve("os-browserify/browser") }'
- install 'os-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "os": false }
webpack compiled with 15 errors and 1 warning
I'm assuming some additional packages are needed other than the weaviate client and graphql, but which ones isn't very clear. Anyone know how to get around this?