Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing components? #2

Open
AdrianDieDose opened this issue Aug 24, 2023 · 3 comments
Open

Missing components? #2

AdrianDieDose opened this issue Aug 24, 2023 · 3 comments

Comments

@AdrianDieDose
Copy link

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
Copy link
Author

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 (

<Component {...pageProps} />

);
}

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

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

}

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

export default MyApp;

@AdrianDieDose
Copy link
Author

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant