react-admin icon indicating copy to clipboard operation
react-admin copied to clipboard

Infinite rerender on no-code example on CodeSandbox

Open smeng9 opened this issue 2 years ago • 2 comments

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):

smeng9 avatar Mar 30 '22 21:03 smeng9

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

slax57 avatar Mar 31 '22 09:03 slax57

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

smeng9 avatar Apr 01 '22 05:04 smeng9

Seems now the codesandbox no longer rerenders infinitely,

but, it still has an error without any console log....

Screenshot from 2022-11-02 15-06-32

Tested against https://codesandbox.io/s/github/marmelab/react-admin/tree/vite-consistent/examples/no-code after vite version bump in #8345

smeng9 avatar Nov 02 '22 20:11 smeng9

I managed to launch your last codesandbox without problem:

image

Is your issue coming from CodeSandbox?

fzaninotto avatar Nov 03 '22 08:11 fzaninotto

https://codesandbox.io/s/github/marmelab/react-admin/tree/master/examples/no-code seems throws bad gateway for now because vite cannot be found.

Screenshot from 2022-11-03 12-50-25

> 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.

smeng9 avatar Nov 03 '22 17:11 smeng9