BuilderIO / partytown

Relocate resource intensive third-party scripts off of the main thread and into a web worker. 🎉
https://partytown.builder.io
MIT License
12.88k stars 427 forks source link

Partytown breaks Next.js app in iOS v11.4- #224

Open alexmardanovgenesis opened 2 years ago

alexmardanovgenesis commented 2 years ago

Describe the bug It looks like all hydration step is missed in iOS less then v11.4. It might be an issue with service worker support. No interactivity on the pages. No errors in console, except in iOS v10: SyntaxError: Unexpected token '...'. Expected a property name.

I suppose, if not supported, it should replace type="text/partytown" with type="text/javascript", but it is done in sw file, so that script will not be ever executed in old iOS.

To Reproduce Steps to reproduce the behavior:

  1. Install Next.js: npx create-next-app@latest
  2. Install Partytown: npm install @builder.io/partytown. Copy lib files in a public folder.
  3. Add some event in page/index.js:
    
    import { useState } from 'react';
    import Head from 'next/head';
    import { Partytown } from '@builder.io/partytown/react';

export default function Home() { const [clicked, setClicked] = useState(false);

return ( <>

My App Githubissues.
  • Githubissues is a development platform for aggregating issues.