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!


4 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

Leave a Reply

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