While Developing the React.js App you might have encounter this error after building your project

Error: “Minified React error #152; visit https://reactjs.org/docs/error-decoder.html?invariant=152&args[]=u for the full message or use the non-minified dev environment for full errors and additional helpful warnings.”

Solution:

Removed the comments from the start of the rendering part (return)

Example Code:

import React from 'react';

function Welcome(props) {
    return (
        // Welcome App
        <div>
            Welcome to Resume Backend
        </div>
    );
}

export default Welcome;

export default Welcome;

Here remove the // Welcome App and the error will be resolved!

We have so many components in the project, which comment should we remove?

Well, you’re lucky we have solution to that as well it’s the simple regex: \(\s*\n?\s*//

use the above regex in VSCode to find the comments

This Way we can fix the Minified React error #152 Issue.

Happy Coding!


7 Comments

splex7 · June 19, 2020 at 5:55 pm

Thanks ! Great solution

madiha · July 19, 2020 at 7:46 am

Thanks, It works,

ILay · August 21, 2020 at 3:59 am

You just best man. Thank you

qhizer · August 28, 2020 at 11:10 pm

Thank you so much man! much love

Raphael Ndiritu · September 12, 2020 at 8:49 pm

Thank you. This issue had stressed me for a whole day

Tarang · September 16, 2020 at 11:12 pm

Thanks Buddy, I invested around 1 or 2 hours for this error, not solved by removing comment from the first line.

    Amit K Khanchandani · November 12, 2020 at 6:13 am

    Hi Taramg,

    The issue still persist or does got resolved?

    We can take a look at it if issue still persist.

Leave a Reply

Your email address will not be published. Required fields are marked *