How to disable minified react?


In my development process, I would like to disable minified code (done by webpack?). Especially when I am tunnelling, because it is often impossible to find where an error comes from. Is it possible to do that, and is it a good idea?
Thanks for your help :slight_smile:


Care to share briefly how your project structure looks alike and whether you’re using UIKit/UIKit2/CustomUI?

For CustomUI I think you need to adjust your webpack.config.js to include

        devtool: 'source-map',
        optimization: {
            minimize: false

…but I guess you’re UIKit2 user, aren’t you?

Thanks @stefan-ok ! You are right, I am on UI Kit 2 :wink:

But I don’t have any webpack.config.js file in my project, only in the node_modules folder. I have added what you said, reloaded forge tunnel, but I still have this kind of errors:

Do you know if there is a way to have this webpack.config.js in my project files (instead of node_modules), and have another version for when the code is in production?

If you’re on UI Kit 2, then forget about my webpack config suggestion, it doesn’t apply: AFAIK there is no webpack involved in the UI Kit 2 at all, at least not configurable by us, app developers. I might be wrong on that and hopefully someone with relevant knowledge will chime in here and explain how to achieve non-minified frontend code in Forge UIKit2 apps. I don’t have such knowledge - sorry for giving you false hopes. :person_shrugging:

Thanks anyway @stefan-ok :wink: . Maybe someone from Atlassian could confirm that you are right? So what solution do we have to debug efficiently?!

Hi @BertrandDrouhard1 , webpack is used to bundle your app before deployment but this isn’t exposed and is controlled by Forge. Looks like React has spot an error in your code. Are all your components correctly imported from @forge/react ? Happy to take a look if you can share a file or code snippet

Thank you @QuocLieu , I was not trying to solve that particular error, but to set up a method to ease the debug process, with more explicit error messages and code / line references. The way it is now is a bit frustrating.