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

"@material-ui/core": "4.12.1" causes prop type error instead of the intended deprecation warning #27205

Closed
ggascoigne opened this issue Jul 9, 2021 · 4 comments · Fixed by #27307
Assignees
Labels
ready to take Help wanted. Guidance available. There is a high chance the change will be accepted

Comments

@ggascoigne
Copy link

I was seeing this:

index.js:1 Warning: Failed prop type: (intermediate value).join is not a function

in my browser console after upgrading to 4.12.1

Looks like the cause is at: https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/Collapse/Collapse.js#L243

unrelated there's another one like this at https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/Accordion/Accordion.js#L177

throw new Error([
        'Material-UI: the classes.container key is deprecated.',
        'Use `classes.root` instead',
        'The name of the pseudo-class was changed for consistency.',
      ]).join('\n');

should be:

throw new Error([
        'Material-UI: the classes.container key is deprecated.',
        'Use `classes.root` instead',
        'The name of the pseudo-class was changed for consistency.',
      ].join('\n'));

The join should be on the array and not on the Error object.

@ggascoigne ggascoigne added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jul 9, 2021
@mnajdova
Copy link
Member

Thanks for reporting @ggascoigne As pointed out this should fix it:

index f80142d72a..d17c20ef53 100644
--- a/packages/material-ui/src/Accordion/Accordion.js
+++ b/packages/material-ui/src/Accordion/Accordion.js
@@ -178,7 +178,7 @@ Accordion.propTypes = {
         'Material-UI: the classes.focused key is deprecated.',
         'Use `classes.focusedVisible` instead',
         'The name of the pseudo-class was changed for consistency.',
-      ]).join('\n');
+      ].join('\n'));
     }

     return null;
diff --git a/packages/material-ui/src/Collapse/Collapse.js b/packages/material-ui/src/Collapse/Collapse.js
index f0aa748bcf..1161cac70f 100644
--- a/packages/material-ui/src/Collapse/Collapse.js
+++ b/packages/material-ui/src/Collapse/Collapse.js
@@ -244,7 +244,7 @@ Collapse.propTypes = {
         'Material-UI: the classes.container key is deprecated.',
         'Use `classes.root` instead',
         'The name of the pseudo-class was changed for consistency.',
-      ]).join('\n');
+      ].join('\n'));
     }

     return null;

@mnajdova mnajdova added OCD21 and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jul 12, 2021
@serenalin121
Copy link
Contributor

Can I work on this?

@mnajdova
Copy link
Member

Yes @serenalin121 I am assigning this to you :)

serenalin121 added a commit to serenalin121/material-ui that referenced this issue Jul 15, 2021
@oliviertassinari oliviertassinari added the ready to take Help wanted. Guidance available. There is a high chance the change will be accepted label Jul 16, 2021
@eps1lon
Copy link
Member

eps1lon commented Jul 19, 2021

Fixed in #27307

@eps1lon eps1lon closed this as completed Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to take Help wanted. Guidance available. There is a high chance the change will be accepted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants