Skip to content

fix: use "unjs/pathe" to make the exported type use relative path #516

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Chrissi2812
Copy link

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

The generated types file .nuxt/types/supabase-database.d.ts contains broken paths examples I tested

path nuxt.config.ts supabase-database.d.ts
/app/types/database.types.ts ~/types/database.types.ts ../..app/types/database.types.ts
/types/database.types.ts ~~/types/database.types.ts ../..types/database.types.ts

The problem is the missing / before the directory name.

So I instead of using a string replacement, it now uses unjs/pathe relative to resolve the path correctly

Resolves: #515

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes (if not applicable, please state why)

How can I add tests for this kind of change? I tested these changes manually in my Nuxt 4 Project.

Manual testing:

  1. Run npm run dev:prepare
  2. Take a look at playgrounds .nuxt/types/supabase-database.d.ts file. Wrong path is used.
export * from '../..types/database.types.ts'
  1. Use this PR and do the same. Now the path should be correct like this
export * from '../../types/database.types.ts'

Copy link

netlify bot commented Aug 11, 2025

👷 Deploy request for n3-supabase pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit c469b4f

Copy link

vercel bot commented Aug 11, 2025

@Chrissi2812 is attempting to deploy a commit to the NuxtLabs Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

pkg-pr-new bot commented Aug 11, 2025

npm i https://pkg.pr.new/@nuxtjs/supabase@516

commit: c469b4f

@BritLuey
Copy link

Tested changes manually in my Nuxt 4 project; no issues.
Low risk change. Would solve main pain point of using this module with Nuxt 4 and Typescript

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Nuxt 4] Types not exported correct inside .nuxt folder
2 participants