-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
TabbedForm validation differences between development and production build #5428
Comments
Our demo (https://marmelab.com/react-admin-demo/#/products/create) is a production build and the tabbed forms do show invalid tabs with correct styles so I believe there is an issue with your setup. We had similar issues in the past and they were all related to multiple conflicting versions of a dependency. Please double check yours, especially packages related to react-admin and material-ui. |
Thanks for the quick response and I will check the demo and our dependency versions. |
This issue has gone silent. Without any way to reproduce the issue, we have to close it. Feel free to comment with new info if you want it reopened. |
@ronaldtb did you discover which packages were conflicting? I'm having a similar issue. Except the css is there but the MUI css is overriding the jss (react-admin css classes). I'm using:
|
I've been struggling with this issue for a while now, so I decided to create a very basic setup using I added a create component which has 2 tabs, and set all fields to required. However in the production build, this doesn't happen. The text remains its original colour. Here is the codesandbox with this basic setup. Here you will see the correct behaviour in the development build. I have also deployed this code directly from the codesandbox via Netlify: https://csb-m5c9z.netlify.app/#/users/create. Here you will see the incorrect behaviour in the production build. Looking at the css in the production build, you can see that the Looking at how they are included in the final build, the So I think this may be related to how the CSS is imported or loaded. @fzaninotto @djhi unless I am doing something wrong, I believe that this is still an issue. |
As a temporary workaround, the errorTabButton color can be overriden with the !important property. Code snippet below:
|
Hey! I have an issue as well, a difference between development or build mode. I have an error in dev mode:
But no error when I build the app. |
The demo seems to allow the reproduction of the error, so I'm reopening the issue. |
Should be fixed by #5984 |
@fzaninotto @djhi I tested this change with the new version 3.13.2 of react-admin but I still face the same behaviour in production builds as mention in my previous comment #5428 (comment) I updated the version in that same project (mentioned in the previous comment). It works fine in development but when I deploy a production build, the behaviour remains incorrect. Based on this, I don't think #5984 fixes this issue. |
The demo is using the production mode and I can't reproduce the issue on it. Please double check the version of all react-admin packages |
I also couldn't reproduce it in the live demo version, but this was true even for before the fix in #5984. So I suspect that the demo version might not be using the latest version of react-admin. Please correct me if I'm wrong? I don't know internally if you update deps and rebuild the live demo version after each release? In the source code for the demo an older version (^3.9.0) of react-admin is specified react-admin/examples/demo/package.json Line 23 in 58e00dc
|
I just redeployed the demo (v3.13.4) and it still doesn't show the problem. Please provide a way to reproduce it. |
updateEverything mentioned above is still valid in order to reproduce the issue. I updated to react-admin v3.13.4 in the codesandbox and did a new deployment so you can see the production build behaviour. Let me know if I should check or change something else. |
What you were expecting:
I was expecting the FormTab instances in a TabbedForm to turn red in case any of the child inputs are invalid. This is working as expected during development. The className "RaTabbedForm-errorTabButton-41" is being added to the FormTab.
Opening the page containing the 'Create' and 'TabbedForm' component shows all tabs as invalid even before pressing the save button.
What happened instead:
After running
yarn build
and deploying this production build the tabs are not being marked as invalid. The inspector is showing a className "jss40", but this class can't be found in the generated sources.The tabs are not turning red on validation errors.
Other information:
Dev environment (yarn start)
Prod environment (yarn build)
Environment
The text was updated successfully, but these errors were encountered: