Thanks for the quick response. Using the gsap/dist/ worked but only after i implemented the ScrollTrigger (Which ScrollSmoother seems to be dependent on) and implementation of a useEffect. Here is my final code.
import React from 'react'
import Footer from './Footer'
import Header from './Header'
import { useRouter } from 'next/router'
import { useEffect } from 'react'
import { gsap } from 'gsap/dist/gsap'
import { ScrollTrigger } from 'gsap/dist/ScrollTrigger'
import { ScrollSmoother } from "gsap/dist/ScrollSmoother"
export default function Layout({ children }) {
gsap.registerPlugin(ScrollTrigger, ScrollSmoother)
useEffect(() => {
const smoother = ScrollSmoother.create({
wrapper: "#smooth-wrapper",
content: "#smooth-content",
})
return () => {
smoother
}
}, [])
const router = useRouter()
return (
<div id='smooth-wrapper' className='grid grid-cols-[1fr] w-full'>
<div id='smooth-content' className={router && router.pathname === '/more' ? 'darkmode' : 'lightmode'}>
{router.pathname !== '/posts/[slug]' && router.pathname !== '/projects/[slug]' ? <Header /> : ''}
<div className='grid py-40 w-auto p-5'>{children}</div>
<Footer />
</div>
</div>
)
}