Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Excel desktop version on Windows refuses to load and parse custom functions metadata file (functions.json) #422

Open
3 tasks done
Yuri2b opened this issue Aug 5, 2024 · 7 comments
Assignees
Labels
Area: Excel Feedback related to Excel add-ins Needs: attention 👋 Waiting on Microsoft to provide feedback Type: product bug Bug in the Office Add-ins platform or Office JavaScript APIs

Comments

@Yuri2b
Copy link

Yuri2b commented Aug 5, 2024

Prerequisites

I am converting some VSTO Excel plugin to use the new JS API. The current plugin has 500+ UDFs that need to be converted into custom functions. I have created a functions.json metadata file describing all these custom functions and have run into the problem that the windows version of Excel refuse to load this functions.json file if it exceeds 1 MB.
I couldn't find any mention of the limitations in Excel's documentation and couldn't find anyone who had encountered this problem. This is so frustrating, especially since the same project with the same functions.json file works fine in the web version of Excel

  • I am running the latest version of Node and the tools
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed

Expected behavior

Excel will load and parse all custom functions from functions.json successfully

Current behavior

No custom function has added to Excel (desktop version)

image

The web version of Excel works without errors or complaints about loading custom functions. All provided functions are visible in the document

Steps to Reproduce

  1. Create node project using yeoman generator with custom functions shared runtime template
  2. Add 500 functions description in src/functions/functions.ts
  3. Check that functions.json generated by custom-functions-metadata-plugin in dist folder is more than 1 Mb
  4. Run devserver with side-loading your add-in to Excel (desktop and web versions)

Context

  • Operating System: Windows 11
  • Node version: Node 18.20.3
  • Office version: Excel for Microsoft 365 MSO (Version 2406 Build 16.0.17726.20078) 64-bit
  • Tool version: custom-functions-metadata-plugin 1.7.0
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP label Aug 5, 2024
@AlexJerabek
Copy link
Contributor

Thanks for reporting this @Yuri2b.

@grangeryy, could you please investigate?

@AlexJerabek AlexJerabek added Needs: attention 👋 Waiting on Microsoft to provide feedback Area: Excel Feedback related to Excel add-ins Type: product bug Bug in the Office Add-ins platform or Office JavaScript APIs and removed Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP labels Aug 5, 2024
@Yuri2b
Copy link
Author

Yuri2b commented Aug 20, 2024

Hey guys, do you have any updates on this? Have you managed to reproduce?

@XuanZhouMSFT
Copy link

XuanZhouMSFT commented Aug 20, 2024

@Yuri2b Thanks for report this issue and waiting for a long time. I can't repro this issue use my local environment and we didn't heard such similar issue recently. Is that possible to provide the manifest or CF metadata files for us to continue investigate?

And we'd like to suggest you also post your question here to get more attentions and it will well triaged: Office-Js Issues
Also, there is a tool for you to local debug, it will provide more error information there: Debug your add-in with runtime logging
What's more, could you help to check if reduce the json file to below 1M could resolve it? We currently have the 1M limitation for metadata file.

@Yuri2b
Copy link
Author

Yuri2b commented Aug 20, 2024

Is that possible to provide the manifest or CF metadata files for us to continue investigate?

This CF file causes an error, its size is 1 MB (1 052 400 bytes). If you remove an arbitrary function from json file and make this file size less then 1 MB (1 048 576 bytes I guess) - it will be loaded without any error and all presented functions will be available.

How I reproduce it:

  1. Build project with npm run build
  2. Place my manifest file to shared folder to side-load it manually
  3. Modify my hosts file by adding 127.0.0.1 -> www.contoso.com reference
  4. Run flashspys/nginx-static in docker with /dist folder mounted to /static
  5. Side-load the add-in in Excel
  6. Toy with dist/functions.json size and try to remove/load the add-in again

functions.json
manifest.xml.txt

@XuanZhouMSFT
Copy link

@Yuri2b Thanks for the information. If reducing file could resolve the issue, it should be the case. Currently we have a size limitation for the metadata of 1MB.

@Yuri2b
Copy link
Author

Yuri2b commented Aug 20, 2024

Currently we have a size limitation for the metadata of 1MB.

Oh, so if you have this limitation - there is no need to raise a new issue on Office-Js Issues right?
Is this behavior documented somewhere? And are there any ways to overcome this limitation? It's a really blocker for what I'm working on now

@XuanZhouMSFT
Copy link

I searched around and didn't find the document. I will open a ticked internally to add it.
For workaround, currently we don't have it. We did some test before and found that around 20k CF may hit the limitation. So we'd like to suggest you to help reducing some description in the metadata file may helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Excel Feedback related to Excel add-ins Needs: attention 👋 Waiting on Microsoft to provide feedback Type: product bug Bug in the Office Add-ins platform or Office JavaScript APIs
Projects
None yet
Development

No branches or pull requests

5 participants