Skip to content

[BUG] Comparison with -0 using the "===" operator will also match 0 [equals-negative-zero] #966

@atali

Description

@atali

Describe the bug

When using supabase with ssr and compiling I got the following warning : Comparison with -0 using the "===" operator will also match 0 [equals-negative-zero]

There is a similar error reported here #321

I have made the following repo to reproduce the error, you just need to run npm run cf:build

npm run cf:build

> [email protected] cf:build
> opennextjs-cloudflare build


┌─────────────────────────────┐
│ OpenNext — Cloudflare build │
└─────────────────────────────┘

App directory: /Users/atali/Developer/ashanti/open-next-equals-negative-zero
Next.js version : 15.4.6
@opennextjs/cloudflare version: 1.11.0
@opennextjs/aws version: 3.8.5

┌─────────────────────────────────┐
│ OpenNext — Building Next.js app │
└─────────────────────────────────┘


> [email protected] build
> next build

Using vars defined in .dev.vars
   ▲ Next.js 15.4.6

Using vars defined in .dev.vars
   Creating an optimized production build ...
Using vars defined in .dev.vars
Using vars defined in .dev.vars
Using vars defined in .dev.vars
 ✓ Compiled successfully in 0ms
 ✓ Linting and checking validity of types    
 ✓ Collecting page data    
 ✓ Generating static pages (7/7)
 ✓ Collecting build traces    
 ✓ Finalizing page optimization    

Route (app)                                 Size  First Load JS    
┌ ○ /                                    5.44 kB         105 kB
├ ○ /_not-found                            991 B         101 kB
├ ○ /error                                 262 B        99.8 kB
└ ○ /login                                 123 B        99.7 kB
+ First Load JS shared by all            99.6 kB
  ├ chunks/4bd1b696-cf72ae8a39fa05aa.js  54.1 kB
  ├ chunks/964-7a34cadcb7695cec.js       43.5 kB
  └ other shared chunks (total)           1.9 kB


○  (Static)  prerendered as static content


┌──────────────────────────────┐
│ OpenNext — Generating bundle │
└──────────────────────────────┘

Bundling middleware function...
Bundling static assets...
Bundling cache assets...
Building server function: default...
Applying code patches: 1.807s
# copyPackageTemplateFiles
⚙️ Bundling the OpenNext server...

▲ [WARNING] Comparison with -0 using the "===" operator will also match 0 [equals-negative-zero]

    .open-next/server-functions/default/.next/server/app/login/page.js:38:13845:
      38 │ ...-e;if(b.unsigned){if(h<0)h+=e;else if(-0===h)return 0}return h}}a.exports=b,b...
         ╵                                          ~~

  Floating-point equality is defined such that 0 and -0 are equal, so "x === -0" returns true
  for both 0 and -0. You need to use "Object.is(x, -0)" instead to test for -0.

Worker saved in `.open-next/worker.js` 🚀

OpenNext build complete.

Steps to reproduce

git clone https://github.com/atali/pen-next-equals-negative-zero
npm install
npm run cf:build

Expected behavior

should not see :
[WARNING] Comparison with -0 using the "===" operator will also match 0 [equals-negative-zero]

@opennextjs/cloudflare version

1.3.0

Wrangler version

4.45.0

next info output

Using vars defined in .dev.vars
/bin/sh: yarn: command not found

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:40 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6041
  Available memory (MB): 131072
  Available CPU cores: 16
Binaries:
  Node: 22.18.0
  npm: 10.9.3
  Yarn: N/A
  pnpm: 9.12.3
Relevant Packages:
  next: 15.4.6 // An outdated version detected (latest is 16.0.1), upgrade is highly recommended!
  eslint-config-next: 15.4.6
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.9.3
Next.js Config:
  output: N/A
 ⚠ An outdated version detected (latest is 16.0.1), upgrade is highly recommended!
   Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.
   Read more - https://nextjs.org/docs/messages/opening-an-issue

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions