-
Notifications
You must be signed in to change notification settings - Fork 9
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
[BUG] Bento components on NEXTJS - ReferenceError: self is not defined #183
Comments
Hi @Beethoven 👋🏻 Would you please try using dynamic Syntax: import dynamic from "next/dynamic";
const <module_name> = dynamic(() =>
import(<path>).then((mod) => mod.<component_to_use>),
{ ssr: false }
); So, this import block: import {
BentoAccordion,
BentoAccordionSection,
BentoAccordionHeader,
BentoAccordionContent,
} from '@bentoproject/accordion/react';
import '@bentoproject/accordion/styles.css'; would be written as: import dynamic from "next/dynamic";
// Use dynamic import with SSR disabled for all imports except CSS
const BentoAccordion = dynamic(() =>
import("@bentoproject/accordion/react").then((mod) => mod.BentoAccordion),
{ ssr: false }
);
const BentoAccordionSection = dynamic(() =>
import("@bentoproject/accordion/react").then((mod) => mod.BentoAccordionSection),
{ ssr: false }
);
const BentoAccordionHeader = dynamic(() =>
import("@bentoproject/accordion/react").then((mod) => mod.BentoAccordionHeader),
{ ssr: false }
);
const BentoAccordionContent = dynamic(() =>
import("@bentoproject/accordion/react").then((mod) => mod.BentoAccordionContent),
{ ssr: false }
);
import "@bentoproject/accordion/styles.css"; For detailed information on dynamic import, refer https://nextjs.org/docs/advanced-features/dynamic-import I am also trying to figure out root cause of the issue. Will post when found! |
Yes, this works, but the robots can't see the info on Accordion (the same with all Bento Components) as It's not rendered on server, only on client. |
And the dos on https://bentojs.dev/documentation/guides/bento-next.js-guide/ is wrong. |
Following guide at
https://bentojs.dev/documentation/guides/bento-next.js-guide/
and gets this error:
ReferenceError: self is not defined
The text was updated successfully, but these errors were encountered: