Open adamxrodriguez opened 11 months ago
same error here
@adamxrodriguez , Are you able to get a solution to this ?
A workaround is cleanup cookies, localstorage, etc...
Still not able to navigate to /admin
but at least you can continue navigating to the site and developing
I was able to fix this somewhat following the instructions from here: https://tina.io/blog/upgrading-to-iframe/
To fix the getPostsList bug, copy the [slug].tsx file from @logan-anderson's tina-fix repo.
I'll try it later
I was able to fix this somewhat following the instructions from here: https://tina.io/blog/upgrading-to-iframe/
1. rename schema.ts to config.ts and replace defineSchema with defineConfig 2. remove wrappers from pages/_app.tsx 3. Delete pages/admin folder 4. Access admin page at /admin/index.html
To fix the getPostsList bug, copy the [slug].tsx file from @logan-anderson's tina-fix repo.
I'm trying to make it works with your instructions but no results.
For now, /admin/index.html doesn't crash anymore but it gives 404.
Here is my _app.tsx
import 'swiper/css';
import 'swiper/css/bundle';
import 'swiper/css/navigation';
import 'swiper/css/autoplay';
import { AppProps } from 'next/dist/shared/lib/router/router';
import dynamic from 'next/dynamic';
import Head from 'next/head';
import { ColorModeScript } from 'nextjs-color-mode';
import React, { PropsWithChildren } from 'react';
import { TinaEditProvider } from 'tinacms/dist/react';
import Footer from 'components/Footer';
import { GlobalStyle } from 'components/GlobalStyles';
import Navbar from 'components/Navbar';
import NavigationDrawer from 'components/NavigationDrawer';
import NewsletterModal from 'components/NewsletterModal';
import WaveCta from 'components/WaveCta';
import { NewsletterModalContextProvider, useNewsletterModalContext } from 'contexts/newsletter-modal.context';
import { NavItems } from 'types';
const navItems: NavItems = [
{ title: 'Awesome SaaS Features', href: '/features' },
{ title: 'Pricing', href: '/pricing' },
{ title: 'Contact', href: '/contact' },
{ title: 'Sign up', href: '/sign-up', outlined: true },
];
const TinaCMS = dynamic(() => import('tinacms'), { ssr: false });
function MyApp({ Component, pageProps }: AppProps) {
return (
<>
<Head>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="" />
<link rel="icon" type="image/png" href="/favicon.png" />
{/* <link rel="alternate" type="application/rss+xml" href={EnvVars.URL + 'rss'} title="RSS 2.0" /> */}
{/* <script
dangerouslySetInnerHTML={{
__html: `window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', 'UA-117119829-1', 'auto');
ga('send', 'pageview');`,
}}
/> */}
{/* <script async src="https://www.google-analytics.com/analytics.js"></script> */}
</Head>
<ColorModeScript />
<GlobalStyle />
<Providers>
<Modals />
<Navbar items={navItems} />
{/* <TinaEditProvider
editMode={
<TinaCMS
query={pageProps.query}
variables={pageProps.variables}
data={pageProps.data}
isLocalClient={!process.env.NEXT_PUBLIC_TINA_CLIENT_ID}
branch={process.env.NEXT_PUBLIC_EDIT_BRANCH}
clientId={process.env.NEXT_PUBLIC_TINA_CLIENT_ID}
{...pageProps}
>
{(livePageProps: any) => <Component {...livePageProps} />}
</TinaCMS>
}
> */}
<Component {...pageProps} />
{/* </TinaEditProvider>
*/} <WaveCta />
<Footer />
</Providers>
</>
);
}
function Providers<T>({ children }: PropsWithChildren<T>) {
return (
<NewsletterModalContextProvider>
<NavigationDrawer items={navItems}>{children}</NavigationDrawer>
</NewsletterModalContextProvider>
);
}
function Modals() {
const { isModalOpened, setIsModalOpened } = useNewsletterModalContext();
if (!isModalOpened) {
return null;
}
return <NewsletterModal onClose={() => setIsModalOpened(false)} />;
}
export default MyApp;
Hi @Ostefanini,
Could you show me your [slug].tsx under pages/blog/?
I was able to fix this somewhat following the instructions from here: https://tina.io/blog/upgrading-to-iframe/
- rename schema.ts to config.ts and replace defineSchema with defineConfig
- remove wrappers from pages/_app.tsx
- Delete pages/admin folder
- Access admin page at /admin/index.html
To fix the getPostsList bug, copy the [slug].tsx file from @logan-anderson's tina-fix repo.
I have the same issue. I tried the tina-fix repo, but it's still not working with this issue. Did you resolve issue? @Ostefanini
Unhandled Runtime Error Error:
schema
is required to be passed as a property toTinaProvider
. You can learn more about this change here: https://github.com/tinacms/tinacms/pull/2823Tried to import and find schema. no luck. not sure how the pull/2823 applies to it. there is a but no in _app.tsx