Skip to content

docs(supabase): document UNUSED_EXTERNAL_IMPORT build warning as false positive#2122

Merged
mandarini merged 1 commit intomasterfrom
docs/unused-imports-warn-docs
Feb 18, 2026
Merged

docs(supabase): document UNUSED_EXTERNAL_IMPORT build warning as false positive#2122
mandarini merged 1 commit intomasterfrom
docs/unused-imports-warn-docs

Conversation

@mandarini
Copy link
Contributor

@mandarini mandarini commented Feb 18, 2026

Description

Adds a "Known Build Warnings" section to packages/core/supabase-js/README.md and a short pointer note to the root README.md, addressing the UNUSED_EXTERNAL_IMPORT warnings that Vite/Rollup/Nuxt users have been reporting (tracked in #2010).

Why now

The warning appears because supabase-js re-exports types like PostgrestError and FunctionsError for consumer convenience. The bundler merges all imports from the same package into a single statement, then flags re-exported names as "unused" because they only appear in an export statement rather than in the code body.
This is a known Rollup/Vite limitation. Nothing is broken and tree-shaking is unaffected.

Changing the build output to work around a bundler heuristic would add complexity and risk for no real gain. Documentation + an onwarn snippet is the right fix for consumers who want clean output.

Changes

  • packages/core/supabase-js/README.md — new "Known Build Warnings" section with explanation, Vite/Rollup snippet, Nuxt snippet
  • README.md (monorepo root) — one-liner pointing to the section above

Type of Change

  • Documentation update (docs)

@mandarini mandarini requested a review from a team as a code owner February 18, 2026 11:49
@github-actions github-actions bot added the supabase-js Related to the supabase-js library. label Feb 18, 2026
@coderabbitai
Copy link

coderabbitai bot commented Feb 18, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Summary by CodeRabbit

  • Documentation
    • Added guidance on known build warnings users may see during builds and why they occur.
    • Clarified that these warnings do not affect the final bundle.
    • Included configuration snippets to help suppress false-positive warnings in Vite, Rollup, and Nuxt environments.

Walkthrough

Adds documentation describing known UNUSED_EXTERNAL_IMPORT build warnings emitted by Rollup/Vite/Nuxt when using supabase-js. Introduces a "Known Build Warnings" section in packages/core/supabase-js/README.md that explains why the warnings occur (re-exports from @supabase/* packages), shows example warning messages, and provides suppression snippets for Vite/Rollup and Nuxt. Updates root README with a pointer to this new section.


Comment @coderabbitai help to get the list of available commands and usage tips.

@mandarini mandarini force-pushed the docs/unused-imports-warn-docs branch from 9e46dd1 to cc06b72 Compare February 18, 2026 12:43
@mandarini mandarini merged commit 32c319b into master Feb 18, 2026
2 checks passed
@mandarini mandarini deleted the docs/unused-imports-warn-docs branch February 18, 2026 12:49
@mandarini mandarini linked an issue Feb 18, 2026 that may be closed by this pull request
7 tasks
mandarini added a commit to supabase/supabase that referenced this pull request Feb 18, 2026
…rning (#42977)

## Description

Adds a troubleshooting article for the `UNUSED_EXTERNAL_IMPORT` build
warnings
that Vite/Rollup/Nuxt users see when bundling apps that use
`@supabase/supabase-js`.

**File:**
`apps/docs/content/troubleshooting/unused-external-import-warning-vite-rollup.mdx`

## What the article covers

- What the warning looks like
- Why it's a false positive (re-exported external imports not recognised
as "used"
  by Rollup's code-body check)
- `onwarn` suppression snippet for Vite/Rollup
- `onwarn` suppression snippet for Nuxt

## Related

- supabase/supabase-js#2010
- supabase/supabase-js#2122

---------

Co-authored-by: Chris Chinchilla <[email protected]>
GuzekAlan added a commit to software-mansion-labs/supabase-js that referenced this pull request Feb 19, 2026
* fix(postgrest): enforce type safety for table and view names in from() method (supabase#2058)

* docs(auth): clarify updateUserById does not trigger client listeners (supabase#2114)

* fix(auth): resolve Firefox content script Promise.then() security errors in locks (supabase#2112)

* build(deps): bump qs from 6.14.1 to 6.14.2 in the npm_and_yarn group across 1 directory (supabase#2118)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(release): version 2.96.0 changelogs (supabase#2121)

Co-authored-by: supabase-releaser[bot] <supabase-releaser[bot]@users.noreply.github.com>

* docs(supabase): document UNUSED_EXTERNAL_IMPORT build warning as false positive (supabase#2122)

* feat(auth): add skipAutoInitialize option to prevent constructor auto-init (supabase#2123)

* chore(release): version 2.97.0 changelogs (supabase#2124)

Co-authored-by: supabase-releaser[bot] <supabase-releaser[bot]@users.noreply.github.com>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Vaibhav <[email protected]>
Co-authored-by: Katerina Skroumpelou <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: supabase-releaser[bot] <223506987+supabase-releaser[bot]@users.noreply.github.com>
Co-authored-by: supabase-releaser[bot] <supabase-releaser[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

supabase-js Related to the supabase-js library.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unused import warnings persist in dist/index.mjs despite #1979 fix

2 participants