Next.js Discord

Discord Forum

Help with no-ssr component

Unanswered
Japanese pilchard posted this in #help-forum
Open in Discord
Japanese pilchardOP
I have this Project section that is no-ssr (because client-side javascript for the carousel), but it is very buggy for some reason and 50% of the time it renders, and 50% it doesn't.


And it keeps giving me these errors
(node:4700) ExperimentalWarning: stream/web is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
(node:11640) ExperimentalWarning: stream/web is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)

3 Replies

Japanese pilchardOP
Source code for carousel component:

'use client'

import React from 'react';
import Container from '../Container/container';
import styles from "./projectsection.module.css"
import { Carousel } from 'react-responsive-carousel';
import "react-responsive-carousel/lib/styles/carousel.min.css";


export default function () {
  return (
    <Container>
      <Carousel
        showArrows={true}
        showIndicators={true}
        infiniteLoop={true}
        dynamicHeight={false}
        showThumbs={false}
        className={styles.mySwiper}
      >
        <div className={styles.item} data-value="1">
          <h1>Robust API for imageboard forum</h1>
          <img src="/screenshot1.png" alt="" />
        </div>
        <div className={styles.item} data-value="2">
          <h1>API for pasting service</h1>
          <img src="/screenshot2.png" alt="" />
        </div>
        <div className={styles.item} data-value="3">
          <h1>General purpose discord bot written in python</h1>
          <img src="/screenshot3.png" alt="" />
        </div>
        <div className={styles.item} data-value="3">
          <h1>AI and Selfbot trained on scraped messages from discord. (Fine tuned on jpg-j6b)</h1>
          <img src="/screenshot4.png" alt="" />
        </div>
      </Carousel>
    </Container>
  );
}
Source code for Parent component

import Container from "../Container/container"
import styles from "./main.module.css"
import AboutMe from "../AboutMe/AboutMe"
import ExpertSection from "../ExpertSection/ExpertSection"
import ExperienceSection from "../ExperienceSection/ExperienceSection"
import dynamic from 'next/dynamic'

// Importing ProjectSection without SSR, due to JavaScript carousel not working properly with SSR
const ProjectSection = dynamic(() => import('../ProjectSection/ProjectSection'), {
  ssr: false,
})

export default function Main() {
    return (<>
        <AboutMe />
        <ExpertSection />
        <ExperienceSection />
        <ProjectSection />
    </>
    )
}