Skip to content

Export CachifiedOptionsWithSchema type#171

Merged
Xiphe merged 1 commit intoepicweb-dev:mainfrom
AhmedBaset:patch-1
Mar 17, 2026
Merged

Export CachifiedOptionsWithSchema type#171
Xiphe merged 1 commit intoepicweb-dev:mainfrom
AhmedBaset:patch-1

Conversation

@AhmedBaset
Copy link
Copy Markdown
Contributor

to fix:

The inferred type of 'cache' cannot be named without a reference to '../../../../node_modules/@epic-web/cachified/dist/src/common'. This is likely not portable. A type annotation is necessary.ts(2742)

When using configure

to fix:
> The inferred type of 'cache' cannot be named without a reference to '../../../../node_modules/@epic-web/cachified/dist/src/common'. This is likely not portable. A type annotation is necessary.ts(2742)

When using `configure`
@kentcdodds kentcdodds requested a review from Xiphe March 15, 2026 05:08
@Xiphe
Copy link
Copy Markdown
Collaborator

Xiphe commented Mar 16, 2026

@AhmedBaset

Makes sense but can you elaborate your scenario? Usually I'd try to avoid explicit type annotations so I'm wondering why you need it.

On my end, this TS warning happens when I have configured a internal module to produce declarations + maps. Maybe your root fix might be ts-config not this. But its hard to tell without more context.

@AhmedBaset
Copy link
Copy Markdown
Contributor Author

CachifiedOptionsWithSchema is part of the public API of configure

My code:

const cache = configure(opts)
//        ^^^^^ The inferred type of 'cache' cannot be named without a reference to '../../../../node_modules/@epic-web/cachified/dist/src/common'. This is likely not portable. A type annotation is necessary.ts(2742)

In my case, it is used in a monorepo where the package is configured to emit .d.ts & maps.

yes I can fix it with tsconfig updates (and I already did since I no longer build with tsc) but I think the type should probably be exported though

@Xiphe Xiphe merged commit 3d9a197 into epicweb-dev:main Mar 17, 2026
4 checks passed
@Xiphe
Copy link
Copy Markdown
Collaborator

Xiphe commented Mar 17, 2026

Yes, I agree! Thanks for the context helps us understand the use-cases and implications!

@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 5.6.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants