1

I have a requirement to add a new field to a custom app that is built in js that is stored in a static resource within a .zip file. I know it's a zip because when I download the file it is without an extension and upon adding .zip it becomes extract-able and then you can see all the sub folders within the folder. I've noticed that after i update the js file and then replace the static resource the app fails to load in Salesforce.

After some investigation I've narrowed the issue down to extracting and compressing the file again breaking the page. Consider this example of what I've been able to reproduce thus far.

load application tab, see that it works -> Download file from static resource -> add .zip extension -> replace existing static resource file with zipped file -> load application tab, see that it still works.

Pre Static resource update

If I extract and compress again the page fails to load:

load application tab, see that it works -> Download file from static resource -> add .zip extension -> extract all files to a folder -> send folder to compressed zip -> replace existing static resource file with zipped file -> load application tab, page no longer loads.

enter image description here

Debug logs give no indication of errors when loading the page. What is the best way to troubleshoot this because I am at a loss as to what to do.

For static resources is there a specific way to compress them in order for it to work?

  • What kind of errors do you see? My idea is simple -- folder structure may be different in re-compressed ZIP (like parent folder is added or so) – kurunve Jun 14 '17 at 19:42
  • Normally it's a vf page that's within a header and sidebar. With the new zip it simply shows a white space where the vf page should be. – Dan Wooding Jun 14 '17 at 19:45
  • Within the zip is 3 folders and an index .html file. They are still there when extracted again after zip. – Dan Wooding Jun 14 '17 at 19:48
  • Can you check what kind of error is shown in Browser development tools? – kurunve Jun 14 '17 at 20:12
2

Instead of doing "Send To > Compressed (zipped) folder" on the folder, do it on the files inside the folder.

When you compress the folder itself, you end up with "foo.zip/foo/bar.js" instead of "foo.zip/bar.js".

  • You're right, if I extract the folder again it is adding another folder, I just don't get how to do what you're suggesting. – Dan Wooding Jun 14 '17 at 21:03
  • Ohh figured it out. it seemed to work. – Dan Wooding Jun 14 '17 at 21:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.