Error: Failed to deploy hosted resources. Each resource can only have up to 5000 files
When I run forge deploy –verbose I can see that all of the files under node_modules are being included (abbreviated):
Packaging app files
Packaging bundled files
, from __forge__.cjs
, from __forge_wrapper__.cjs
...
Archive created: /var/folders/1r/yrgnww510pbdn5c53hgbxh2r0000gn/T/tmp-81847-WJshFWMEHdLa-.zip
NativeUI bundle created: /var/folders/1r/yrgnww510pbdn5c53hgbxh2r0000gn/T/forge-native-ui-81847-tj2lOHvrG3iW
NativeUI bundle created: /var/folders/1r/yrgnww510pbdn5c53hgbxh2r0000gn/T/forge-native-ui-81847-cgRtCdAaHRo0
NativeUI bundle created: /var/folders/1r/yrgnww510pbdn5c53hgbxh2r0000gn/T/forge-native-ui-81847-Lj7ARgsoTRlK
, from index.html
, from assets/...
, from img/...
, from dashboard/...
, from dashboard/dist/...
, from dashboard/package.
...
, from dashboard/node_modules/ansi-regex/index.js
, from dashboard/node_modules/acorn-jsx/xhtml.js
, from dashboard/node_modules/ansi-regex/index.d.ts
, from dashboard/node_modules/ansi-regex/license
, from dashboard/node_modules/ansi-regex/readme.md
, from dashboard/node_modules/acorn-jsx/index.js
... .etc. ...
I have found similar questions about this posted but none has a satisfactory answer.
Yes, that’s what I’ve done as a work-around. It would be helpful if you guys could update the docs. The demos, example apps, and online docs I could find all talk about putting the custom UI project under static including package.json and then doing an npm install from there, which created a node_modules folder. This results in everything being uploaded, and often goes over the 5000 file limit.
There are other unanswered posts in dev community about this problem. One even has someone suggesting to use ‘.forgeignore’ which I believe is from another forge platform. I had an AI assistant suggest creating this file while I was debugging this problem. Also, running forge create and selecting ‘Custom UI’ does the same thing (creates the custom ui app under /static).
Oh boy, I figured out what is going on. I had an older static resource for my images, and when I moved the dashboard under static, I just added another one: