next-tinacms-blog-kit icon indicating copy to clipboard operation
next-tinacms-blog-kit copied to clipboard

Missing components?

Open AdrianDieDose opened this issue 2 years ago • 3 comments

Hey, im trying to setup your project but im stuck with a missing file as it seems:

wait - compiling... error - ./pages/_app.tsx:22:12 Module not found: Can't resolve '../.tina/components/TinaDynamicProvider' 20 | if (shouldUseTinaEditor()) { 21 | const Tina = dynamic(

22 | () => import('../.tina/components/TinaDynamicProvider'), | ^ 23 | { 24 | ssr: false, 25 | }

My .tina didnt even have a components folder. I tough i need to copy it from the root structure ./components but still there is no TinaDynamicProvider.

Best wishes!

AdrianDieDose avatar Aug 24 '23 23:08 AdrianDieDose

I have found the issue, i removed the import statement xD Isnt required for some reason ?

My _app,tsx now:

import type { AppProps } from 'next/app'; import dynamic from 'next/dynamic';

import '../styles/globals.css';

import ThemeProvider from '~/components/ThemeProvider'; import shouldUseTinaEditor from "~/lib/should-use-tina-editor";

function MyApp({ Component, pageProps }: AppProps) { return ( <ThemeProvider> <Component {...pageProps} /> </ThemeProvider> ); }

function TinaWrapper(props: React.PropsWithChildren<{}>) { if (shouldUseTinaEditor()) { const Tina = dynamic( { ssr: false, } );

return <Tina>{props.children}</Tina>;

}

return <>{props.children}</>; }

export default MyApp;

AdrianDieDose avatar Aug 24 '23 23:08 AdrianDieDose

Still problems when logging into /admin/index.html: Failed to compile ./pages/admin.tsx:2:0 Module not found: Can't resolve '../.tina/components/TinaDynamicProvider' 1 | import { TinaAdmin } from 'tinacms';

2 | import Tina from '../.tina/components/TinaDynamicProvider'; 3 | 4 | function Admin() { 5 | return (

https://nextjs.org/docs/messages/module-not-found

AdrianDieDose avatar Aug 24 '23 23:08 AdrianDieDose

Fixed: New _app.tsx:

import type { AppProps } from 'next/app'; import dynamic from 'next/dynamic';

import '../styles/globals.css';

const App = ({ Component, pageProps }) => { return <Component {...pageProps} /> }

export default App

AdrianDieDose avatar Aug 24 '23 23:08 AdrianDieDose