Coder Social home page Coder Social logo

Comments (8)

glr0221 avatar glr0221 commented on August 10, 2024 1

@Adrian-MSFT @exextoc

After a lot of trial and error, and line by line process of elimination, I found the piece of code causing a crash in chakra JS engines. It was a line trying to add/concatenate two structures.

I wish to thank you all greatly for your support and all your responses. Without your guidance and help, I would have never found the offending code. I would have proceeded blindly with the debug registries enabled.

Thank you all so much and closing this ticket.

from office-js.

glr0221 avatar glr0221 commented on August 10, 2024

any feedback on this @exextoc? Thank you.

from office-js.

exextoc avatar exextoc commented on August 10, 2024

We tried reproing this on our builds, and it should work correctly. (we tried both our internal add-in and the manifest that you provided).

I did some network capture and found out clicking the report button does not download the necessary javascript files and resources.

This is suspicious. This will certainly cause an error if the bundle.js file is not downloaded. Can you check if the bundle is there?

C:\Users\[username]\AppData\Local\Microsoft\Office\16.0\Wef\[GUID]\[Encoding]\Javascript\[Add-in ID]\bundle.js

We simulated the bundle not downloading, and got the same results as you.

If we enable the debug registry for the addin (https://learn.microsoft.com/en-us/office/dev/add-ins/outlook/debug-autolaunch?tabs=windows#mark-your-add-in-for-debugging-and-set-the-debugger-port) then the addin works.

This is also interesting. In that setting the debug setting will change the JS engine to V8 instead of Chakra. (note that MEC builds are still running Chakra, but the Monthly CC builds have moved to V8). So if your JS bundle contains some things that are not compatible with Chakra this could be the cause.

However, we did test your sample manifest with Chakra and it seemed to work, so I think likely this may be a bundle.js download issue instead.

from office-js.

glr0221 avatar glr0221 commented on August 10, 2024

Hello @exextoc,

I have tested again with the monthly enterprise channel and found that all the Javascript files are downloaded during the loading of outlook. So in effect all bundle.js files are present.

The part that is interesting though is that in the current/beta channels, when the report button is clicked, it tries to get a copy of the JS file and allowed.json file. In the failing version both files are not downloaded. Here is what I did :

  1. Opened Outlook with 2 instances (different AppIDs) of the same spam button. (Opening outlook downloads all the JS files for addins.)
  2. Enabled debugging for 1 of the AppIds.
  3. Deleted the bundle.js for both instances.
  4. Clicked on debuggable instance and found that it created a bundle.js file and a map file in the WEF folder.
  5. Clicked on non-debuggable instance and found that it did not create the bundle.js file.

I don't know about chakra, but if our code works in your tests, then it should work with the MEC-Chakra version right? How do we know if the Outlook client is chakra or V8 powered? Is there a test we can ask our customers to run to determine the JS engine? Are other channels (Current, semi-annual, etc...) powered by chakra as well?

Any advice on how to proceed? Or is there a plan to migrate everything to V8 any time soon?

Thank you very much.

from office-js.

Adrian-MSFT avatar Adrian-MSFT commented on August 10, 2024

I have tested again with the monthly enterprise channel and found that all the Javascript files are downloaded during the loading of outlook. So in effect all bundle.js files are present.

This seems to indicate that the bundle download is working as intended - the bundle files should be downloaded when Outlook boots

However, we're a bit confused by the next part:

The part that is interesting though is that in the current/beta channels, when the report button is clicked, it tries to get a copy of the JS file and allowed.json file. In the failing version both files are not downloaded. Here is what I did :

By "failing version", do you mean MEC? Or by "failing version", do you mean the add-in that is not marked for debugging from your steps below?

  1. Opened Outlook with 2 instances (different AppIDs) of the same spam button. (Opening outlook downloads all the JS files for addins.)
  2. Enabled debugging for 1 of the AppIds.
  3. Deleted the bundle.js for both instances.
  4. Clicked on debuggable instance and found that it created a bundle.js file and a map file in the WEF folder.
  5. Clicked on non-debuggable instance and found that it did not create the bundle.js file.

These steps are executed in MEC, correct? Not current/beta channels? When you set the debug registry key for an add-in, Outlook will be more aggressive in downloading the bundle in order to help developers with debugging, which is why you are seeing this happening in the add-in marked for debugging.

I don't know about chakra, but if our code works in your tests, then it should work with the MEC-Chakra version right? How do we know if the Outlook client is chakra or V8 powered? Is there a test we can ask our customers to run to determine the JS engine? Are other channels (Current, semi-annual, etc...) powered by chakra as well?

Any advice on how to proceed? Or is there a plan to migrate everything to V8 any time soon?

Based on our testing, yes, the code works in MEC-Chakra version. Unfortunately, there is no easy way to check what version of the engine is running, but V8 should be enabled now for all channels except MEC and semi-annual, as of now. MEC V8 enablement should come soon in the near future.

from office-js.

glr0221 avatar glr0221 commented on August 10, 2024

Thank you for all the answers @Adrian-MSFT .

You are right, all these tests were done in the MEC version. And that when I was saying 'failing version', I meant the addin without the debug-registry enabled. This sentence explains what I was seeing :

When you set the debug registry key for an add-in, Outlook will be more aggressive in downloading the bundle in order to help developers with debugging, which is why you are seeing this happening in the add-in marked for debugging.

May I know how I can test the code in MEC-Chakra version like what you did? I intend to test our releases against it. As for V8 enablement, do you have any timelines that you can share? Will V8 be enabled for semi-annual as well? Thank you very very much.

from office-js.

Adrian-MSFT avatar Adrian-MSFT commented on August 10, 2024

@glr0221 Since MEC is not on V8 yet, running any spam add-in in MEC (without the debug registry key set) should be testing the code against the MEC-Chakra version.

I reached out to the team that owns our JS engines. Unfortunately, they do not have any concrete timelines to share for the V8 enablement in these channels.

from office-js.

glr0221 avatar glr0221 commented on August 10, 2024

Thank you for all your answers @Adrian-MSFT . Thank you also for reaching out to your internal teams in hope of getting an update on the V8 roll out.

I will check and see if I can figure this one out. I will have to do trial and error to find the offending code.
Thanks again.

from office-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.