I am trying to integrate Partytown in my website and following the HTML integration.
And have included partytown.js as inline script in
. And have configured window.partytown with correct path for "lib".
Since partytown.js requests the partytown-sw.js, In chrome browser network tab I get 200 status for partytown-sw.js,
But in console it throws error:
DOMException: Failed to register a ServiceWorker for scope ("https://www.example.com/static/js/src/partytown/lib/") with script ("https://www.example.com/static/js/src/partytown-sw.js"): The script does not have a MIME type
I checked if there is any issue in the path of file but that's not the case, as going to link https://www.example.com/static/js/src/partytown-sw.js gives the correct JS file in browser.
I definitely think this issue is related to Partytown service worker file, as I came accross a blog where some author mentioned above same MIME type issue with the loading of Partytown Service Worker file.
Blog link: https://maxchadwick.xyz/blog/experimenting-with-partytown
(I tried with latest version of Partytown, it still has this error)
Any quick help or fix or workaround on this is highly appreciated!!
Describe the bug
I am trying to integrate Partytown in my website and following the HTML integration. And have included partytown.js as inline script in
. And have configured window.partytown with correct path for "lib".Since partytown.js requests the partytown-sw.js, In chrome browser network tab I get 200 status for partytown-sw.js,
But in console it throws error:
DOMException: Failed to register a ServiceWorker for scope ("https://www.example.com/static/js/src/partytown/lib/") with script ("https://www.example.com/static/js/src/partytown-sw.js"): The script does not have a MIME type
I checked if there is any issue in the path of file but that's not the case, as going to link
https://www.example.com/static/js/src/partytown-sw.js
gives the correct JS file in browser.I definitely think this issue is related to Partytown service worker file, as I came accross a blog where some author mentioned above same
MIME type
issue with the loading of Partytown Service Worker file. Blog link: https://maxchadwick.xyz/blog/experimenting-with-partytown(I tried with latest version of Partytown, it still has this error)
Any quick help or fix or workaround on this is highly appreciated!!
Reproduction
https://maxchadwick.xyz/blog/experimenting-with-partytown
Steps to reproduce
(I only tried the latest Partytown version, not sure about old versions)
Browser Info
Chrome, Firefox
Additional Information
No response