Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

569
Views
Disable-devtool in Next.js

I am currently building an app in Next.js and I want to disable opening devtools. I found a nice package on npm - Disable-devtool - npm link but the problem is that nextjs keeps throwing me ReferenceError: navigator is not defined. I tried to look into node_modules but didn't find any solution whatsoever, any help please?

Thank you ❤️

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Try this:

    if (
        typeof window !== "undefined" &&
        typeof window.navigator !== "undefined" &&
        typeof navigator !== "undefined" &&
        navigator.userAgent
    ) {
        const disableDevtool = require("disable-devtool");
        disableDevtool();
    }
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!