← All tasks
javascriptsupabase/supabase-js #1880Not a task: not reproduced

^2.82.0: "Cannot find module" error in Nuxt environment (2.83, 2.84)

envgap__supabase__supabase-js-1880

Original GitHub issue ↗Opened 2025-11-20

01 / FAILURE SIGNATURE

As reported upstream

message: "Cannot find module
Not a benchmark task.
  • No curated issue-specific recipe or verified environment fix is available.

02 / ENVIRONMENT RECIPE

Base commit
Not freshly verified
Manifest
package.json
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

supabase/supabase-js #1880 · read the original issue
### Describe the bug

After updating @supabase/supabase-js to version 2.84.0 in a Nuxt 3 project, running the development server (npm run dev) fails with a ERR_MODULE_NOT_FOUND error.
The error message suggests that the library or the consuming environment is trying to import an internal file (dist/main/lib/constants) without the .js extension. This fails in the Nuxt ESM environment (.nuxt/dev/index.mjs).
Downgrading to version 2.81.1 resolves the issue immediately.

### Library affected

supabase-js

### Reproduction

_No response_

### Steps to reproduce

1. Create a Nuxt 3 project (or use an existing one).
2. Install the latest version of the library: npm install @supabase/supabase-js@2.84.0
3. Run the dev server: npm run dev
4. Observe the error in the terminal.

### System Info

```shell
% npx envinfo --system --npmPackages '{supabase,@supabase/*}' --binaries --browsers

  System:
    OS: macOS 26.1
    CPU: (10) arm64 Apple M4
    Memory: 216.83 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.16.0 - /Users/user/.nvm/versions/node/v22.16.0/bin/node
    npm: 10.9.2 - /Users/user/.nvm/versions/node/v22.16.0/bin/npm
  Browsers:
    Chrome: 142.0.7444.176
    Safari: 26.1
  npmPackages:
    @supabase/supabase-js: 2.81.1 => 2.81.1
```

### Used Package Manager

npm

### Logs

<details>
<summary>Click to expand!</summary>

```shell
Error {▼
  name: 'Error',
  message: "Cannot find module 
  '/Users/[username]/Git/[project]/node_modules/@supabase/supabase-js/dist/main/lib/constants' 
  imported from /Users/[username]/Git/[project]/.nuxt/dev/index.mjs\n" +
  
  'Did you mean to import 
  "/Users/[username]/Git/[project]/node_modules/@supabase/supabase-js/dist/main/lib/constants.js"?',
  stack: "Cannot find module '/Users/[username]/Git/[project]/node_modules/@supabase/supabase-js/dist/main/lib/constants' imported from /Users/[username]/Git/[project]/.nuxt/dev/index.mjs\n" +
  'Did you mean to import "/Users/[username]/Git/[project]/node_modules/@supabase/supabase-js/dist/main/lib/constants.js"?\n' +
  '    at finalizeResolution (node:internal/modules/esm/resolve:275:11)\n' +
  '    at moduleResolve (node:internal/modules/esm/resolve:860:10)\n' +
  '    at defaultResolve (node:internal/modules/esm/resolve:984:11)\n' +
  '    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:780:12)\n' +
  '    at #cachedDefaultResolve (node:internal/modules/esm/loader:704:25)\n' +
  '    at ModuleLoader.resolve (node:internal/modules/esm/loader:687:38)\n' +
  '    at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:305:38)\n' +
  '    at ModuleJob._link (node:internal/modules/esm/module_job:137:49)',
  code: 'ERR_MODULE_NOT_FOUND',
  url: 'file:///Users/[username]/Git/[project]/node_modules/@supabase/supabase-js/dist/main/lib/constants',
  unhandled: false,
  [Symbol(Symbol.toStringTag)]: 'Error',}
```
</details>

### Validations

- [x] Follow our [Code of Conduct](https://github.com/supabase/.github/blob/main/CODE_
Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]

Issue-specific recipe and runtime smoke command require review against the complete issue and repository.

Legacy already_works is install-only; proposed control still requires runtime verification.