Next.js Discord

Discord Forum

tidycal not working properly

Unanswered
Atlantic mackerel posted this in #help-forum
Open in Discord
Atlantic mackerelOP
I'm trying to make my tidycal cdn works on the next 14 but got unsuccessful, the calendar loads great at first but after navigating to another page the content disappears.
'use client'
import React, { useEffect } from 'react'
import Script from 'next/script';

export const dynamic = "force-dynamic";

const page = () => {

    useEffect(() => {
        //create a script and injecte it
        const script = document.createElement("script");
        script.src = "https://asset-tidycal.b-cdn.net/js/embed.js";
        script.async = true;
        document.body.appendChild(script);
        script.onload = () => {
            
            console.log(`script loaded correctly, tidycal onLoad has been populated`)
        }
        return () => {
            console.log('stuff has been removed');
          document.body.removeChild(script);
          
        };
        
    })

  return (
        <div>
            <div className='tidycal-embed' data-path='etwincorp/consultation-paypal'></div>
        </div>
  );
}

export default page

comming back on the page I get this error though:
iFrameSizer][Host page: tidycal-embed-xjtvr] [iFrame requested init] IFrame(tidycal-embed-xjtvr) not found
any help would be appreciated

0 Replies