
Getting 404 Errors After Building a Teams Tab App? HTML Caching Might Be the Cause
Getting 404 Errors After Building a Teams Tab App? HTML Caching Might Be the Cause Introduction When developing Microsoft Teams tab apps, there's a frustrating issue you may run into during local development. After modifying frontend code and rebuilding, Vite/Rollup adds a content hash to filenames (e.g., TeamsInitializer.bBRVpIft.js ). However, if the browser (Teams WebView) has cached the HTML, the old HTML continues to reference the old hashed filenames, which results in 404 errors . In this article, we'll share a solution we discovered by digging into the internal structure of the Teams SDK v2 local server. Common Solutions and Their Drawbacks Approach 1: Remove Hashes from Filenames // astro.config.mjs or vite.config.js export default { vite : { build : { rollupOptions : { output : { entryFileNames : ' assets/[name].js ' , chunkFileNames : ' assets/[name].js ' , assetFileNames : ' assets/[name].[ext] ' , }, }, }, }, }; Drawback : Removing hashes means the browser may cache files i
Continue reading on Dev.to
Opens in a new tab




