Next.js Discord

Discord Forum

Localstorage errors when localstorage is not in use

Answered
Rufous Hummingbird posted this in #help-forum
Open in Discord
Rufous HummingbirdOP
Hello,

I was working on my app perfectly fine yesterday, but when I go to open it up and run it I get these errors:

(node:13627) Warning: --localstorage-file was provided without a valid path
(Use node --trace-warnings ... to show where the warning was created)
⨯ [TypeError: localStorage.getItem is not a function] {
digest: '4185522436'
}
[TypeError: localStorage.getItem is not a function]
⨯ [TypeError: localStorage.getItem is not a function] { page: '/' }

I was using the default npm run dev and the page errors with code 500.
The page does not use any localstorage functions.
Any help would be greatly appreciated!

Thanks,
@Rufous Hummingbird
Answered by Rufous Hummingbird
It fixed itself some how, I reconfigured the project and that fixed it
View full answer

6 Replies

Rufous HummingbirdOP
Page in question:
// import Image from "next/image";

export default function Home() {
  return (
    <>
    <nav className="bg-gray-400">
      <div className="h-16 mx-2 sm:mx-8 flex flex-1 justify-between ">
        <div className="flex justify-center items-center">
          <div className="flex">
            <a className="text-2xl px-3 text-black">Home</a>
            <a className="text-2xl px-3 text-black">Calendar</a>
            <a href="/form"className="text-2xl px-3 text-black">Form</a>
          </div>
        </div>
        <div className=" flex items-center px-5">
          <a href="/my-account" className="">My Account</a>
        </div>
      </div>
    </nav>
    <div>
      
    </div>
    </>


  );
}
Rufous HummingbirdOP
It fixed itself some how, I reconfigured the project and that fixed it
Answer
Rufous HummingbirdOP
Thanks, I think I had tsconfig reconstructed and that fixed it
awesome