jakeburden / next-absolute-url

Get the absolute URL of your Next.js app (optionally set a localhost dev URL)
300 stars 30 forks source link

Window is not defined #30

Open sid86-dev opened 2 years ago

sid86-dev commented 2 years ago

ReferenceError: window is not defined

export const getStaticProps: GetStaticProps<IProps> = async ({req}) => {
  59 | 
> 60 | const { origin } = absoluteUrl(req);
     |                               ^
  61 | const apiURL = `${origin}/api/job.js`;
  62 | console.log(origin);