Skip to content
Discussion options

You must be logged in to vote

So, I have:

import Script from "next/script";
import "../scripts/my.script";

export default function Home() {
  return (
    <>
      <Script src="/fooo.js" />
      <div>Scripts</div>
    </>
  )
}

And that gives:

And the script:

'use client'
import $ from 'jquery'

if (typeof window !== 'undefined') {
  console.log("hello")

  $(document).ready(function () {
    console.log("ready")
  });
}

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
6 replies
@DemeSzabolcs
Comment options

@icyJoseph
Comment options

@icyJoseph
Comment options

Answer selected by DemeSzabolcs
@DemeSzabolcs
Comment options

@icyJoseph
Comment options

@DemeSzabolcs
Comment options

Comment options

You must be logged in to vote
1 reply
@DemeSzabolcs
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants