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?
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.
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?
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.