Uncaught TypeError: Om is not a function

I built a react app with vite and everything works fine in the dev server, but when I build it I get a blank white page and the console contains the error:
Uncaught TypeError: Om is not a function

I looked where it was pointing to in the code and seems to be upset at this:
h.useState(Om(Date.now()))

Which seems to be this line
  const [dateTime, setDateTime] = useState<dayJs.Dayjs>(dayJs(Date.now()));

Which seems like it's saying dayjs isn't a function, but at the top of the file I have
import * as dayJs from "dayjs";

And it works as intended in the development server. It only breaks when I build.
Any help would be greatly appreciated.
Was this page helpful?