Packing React App

Hello,

I would like to pack a react app, however, I got the error “Package size exceeds the 5MB limit” since my react Freshdesk app contains many libraries in node modules. Can I pack the app without the node-modules folder, or it is a must-have? Is there any solution to this problem?

Thank you

1 Like

Hi Nhat,

Can you share your folder structure?
The app folder contains the built/compiled assets of the app, and the src folder is at root. Therefore no node_modules folder would be present in the app, and this should not gives us error while packing the app through fdk pack.

1 Like

This is my folder structure. Perhaps too many SVG in the resource folder causes the error? The SVG is generated when I import a library for creating Dashboard.



image

2 Likes

Oh, that might be the reason. In that case, I am sorry, I won’t be able to help much.

Hope this gets figure out soon for you :slight_smile:

2 Likes

That might be the reason. Let us check with the app platform and get back to you.

1 Like

Hello,

I have optimized by using the webpack.config.js and the size I saw in the report Webpack Bundle Analyzer has gone down to 4.93MB. However, when I run fdk pack, it still throws the error “Package size exceeds the 5MB limit”. What size does the FreshDesk mean here? This is the report generated by Webpack Bundle Analyzer.report.zip (148.2 KB) . Could you have a look on it and tell me why?

1 Like

@Nhat_Nguyen,

As you run fdk pack this time, can you do it this way NODE_DEBUG=fdk fdk run as described here,

Share the areas in the logs those direct towards Package Size Exceeds error. Or you can copy-paste the suspected couple of lines or all lines on this thread. This will help us understand if it’s really problem with CLI or any 3rd party dependency. Depending on what we learn, I will initiate a private message with you to see how I can reproduce this issue.

1 Like