OfficeDev/office-js

word-web-16.00.js not up to date

Closed this issue · 6 comments

Provide required information needed to triage your issue

Your Environment

  • Platform [PC desktop, Mac, iOS, Office on the web]: web
  • Host [Excel, Word, PowerPoint, etc.]: word
  • NPM version number: 1.1.93
  • Operating System: Fedora
  • Browser (if using Office on the web): Chrome

Expected behavior

Word API 1.7 features should be available when hosting js library on own webserver as indicated in Readme.md, by copying content of /dist dir to webpath.

Current behavior

The script word-web-16.00.js is successfully loaded, however the file itself is not up to date with the currently published version on CDN, using ctrl + f the published version under https://appsforoffice.microsoft.com/lib/1/hosted/word-web-16.00.js containes Paragraph.insertAnnotations however the version published on NPM does not...

Steps to reproduce

  1. Serve the JS API on webserver by copying /dist content from npm package
  2. Use the hosted JS API to use Word API v. 1.7 features e.g. Paragraph.insertAnnotations
  3. See TypeError function not available

(No) Link to live example(s)

  1. Live examples like script lab don't apply as they embed the script from the CDN not from the npm package.

Provide additional details

Context

Why is there a version mismatch? Is the possibility of serving the API on own webserver not intended anymore?

Useful logs - Not relevant

Thank you for taking the time to report an issue. Our triage team will respond to you in less than 72 hours. Normally, response time is <10 hours Monday through Friday. We do not triage on weekends.

Hi @aurelius-adrian Thanks for reporting this issue. The NPM package for Office.js is a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js. It has historically been released about once per month, while the CDN has always contains latest updates. If using CDN version is applicable, better to use this one as latest.

I couldn't find a way to download all components of the office API (all files in the npm dist folder) from the CDN. If that is possible, this would be a solution to my problem.

On a side note though, the version numbers of the files word-web-16.00.js are identical on npm and the CDN, and as far as I can tell, please excuse me if I'm wrong, the npm version has not been updated in 2 years at least on GitHub. As a developer it is hard to debug errors that arise from this.

Also I hope that I understood the intended use of the repository correctly, as it says on the NPM readme that the API can also be used by hosting it yourself, by copying the dist folder content to the webpath.

Thank you for your help!

Hi @aurelius-adrian, I found this referencing it about : https://learn.microsoft.com/en-us/office/dev/add-ins/develop/referencing-the-javascript-api-for-office-library-from-its-cdn, Could you try "You can install these types with npm install --save-dev @types/office-js-preview"? If it's not helpful, please let us know. Thanks.

I tried this already and didn't solve my issue unfortunately, I have downloaded the file manually and replaced it in my webpath it works now. I want to find a solution though that isn't a hack in this way.

Hi @aurelius-adrian, So glad that you have found a solution to work around. Also we'll look into this problem, will report back here if we have a suggestion for you. Thanks.

Thank you very much!