react-admin
react-admin copied to clipboard
Infinite rerender on no-code example on CodeSandbox
What you were expecting:
The codesandbox should not keep rerendering the view
What happened instead:
the view gets rerendered infinitely
Steps to reproduce:
Create a sandbox using https://github.com/marmelab/react-admin/tree/next/examples/no-code
Related code:
https://codesandbox.io/s/github/marmelab/react-admin/tree/next/examples/no-code?file=/vite.config.ts
Other information:
Environment
- React-admin version: 4.0.0-rc.0
- Last version that did not exhibit the issue (if applicable): 3.19
- React version:
- Browser: Edge 99
- Stack trace (in case of a JS error):
Hello! Thank you for submitting this issue. This looks like a codesandbox only issue, since I have no problem running the no-code example locally. We'll look into that and keep you updated! Cheers
Hi @slax57 Checkout this repo's config, it is no longer having infinite loop, can you also verify if the local one works fine for you? https://codesandbox.io/s/wandering-wind-zcpkf3?file=/vite.config.ts
Seems now the codesandbox no longer rerenders infinitely,
but, it still has an error without any console log....
Tested against https://codesandbox.io/s/github/marmelab/react-admin/tree/vite-consistent/examples/no-code after vite version bump in #8345
I managed to launch your last codesandbox without problem:

Is your issue coming from CodeSandbox?
https://codesandbox.io/s/github/marmelab/react-admin/tree/master/examples/no-code seems throws bad gateway for now because vite cannot be found.
> Sandbox Container: Starting sandbox v0m0x...
yarn install v1.22.19
warning package.json: No license field
info No lockfile found.
warning [email protected]: No license field
[1/4] Resolving packages...
warning ra-data-local-storage > ra-data-fakerest > fakerest > babel-runtime > [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage dueto the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
[2/4] Fetching packages...
[-------------------------------------------------------[##########---------------------------------------------[#################--------------------------------------[####################-----------------------------------[#############################--------------------------[####################################################---[#######################################################[#######################################################[#######################################################[#######################################################[#######################################################error @mui/[email protected]: The engine "node" is incompatible with this module. Expected version ">=12.0.0". Got "10.24.1"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
> Sandbox Container: Sandbox v0m0x started
yarn run v1.22.19
warning package.json: No license field
$ vite
/bin/sh: 1: vite: not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
yarn run v1.22.19
warning package.json: No license field
$ vite
/bin/sh: 1: vite: not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
yarn run v1.22.19
warning package.json: No license field
$ vite
/bin/sh: 1: vite: not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
yarn run v1.22.19
warning package.json: No license field
$ vite
/bin/sh: 1: vite: not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Huh, I have to fork and change the starting script in https://codesandbox.io/s/pedantic-ully-d1so8d?file=/package.json:64-83 from "dev": "vite",
to "dev": "yarn vite",
in order to get it work.
The infinite rerender loop is indeed resolved.