Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hello world example gives multiple errors, starting with "Can't resolve 'crypto' " #5480

Open
2 tasks done
francis-vila opened this issue Apr 10, 2024 · 0 comments
Open
2 tasks done

Comments

@francis-vila
Copy link

TanStack Table version

both ^7.8.0 and ^8.15.3

Framework/Library version

^18.2.0

Describe the bug and the steps to reproduce it

I created a new app with create-react-app then tried creating a minimal table with examples from the documentation.

I tried different examples, the ones in codeSandBox being from https://react-table-v7-docs.netlify.app/docs/quick-start .

2 sandboxes:
https://codesandbox.io/p/sandbox/7-8-0-react-table-hello-world-l8jytv?file=%2Fpackage.json
https://codesandbox.io/p/sandbox/8-15-3-react-table-hello-world-4cww47?file=%2Fsrc%2FApp.js

I either get a blank page, or multiple errors, depending on the versions of react-table and other modules.
I received the errors on Windows 11, from a basic installation of create-react-app, with version 18.2.0 of react. (I can't reproduce that in codesandbox. )

I have attempted multiple solutions found on StackOverflow, such as using react-app-rewired with a config-overrides.js file , installing-uninstalling modules, reverting to version 4 of react-scripts, etc.

With "@tanstack/react-table": "^8.15.3" on vscode, I get errors such as the one below.

Module not found: Error: Can't resolve 'crypto' in 'C:\projects\react_2024_3\node_modules\crypto-extra\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 }

Your Minimal, Reproducible Example - (Sandbox Highly Recommended)

https://codesandbox.io/p/sandbox/7-8-0-react-table-hello-world-l8jytv?file=%2Fpackage.json

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

None

Terms & Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant