Skip to content
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

Inaccessible 'unique symbol' when using @tanstack/svelte-query #1493

Open
Conceptiks opened this issue Dec 20, 2024 · 1 comment
Open

Inaccessible 'unique symbol' when using @tanstack/svelte-query #1493

Conceptiks opened this issue Dec 20, 2024 · 1 comment
Labels
bug 🔥 Something isn't working

Comments

@Conceptiks
Copy link

Description

When using the @tanstack/svelte-query plugin within fastify, the svelte-query.gen.ts file generates just fine. However, I get the following error in all of my requestResourceOptions():

The inferred type of 'getStatusOptions' references an inaccessible 'unique symbol' type. A type annotation is necessary.ts(2527)
---
Exported variable 'getStatusOptions' has or is using name 'dataTagErrorSymbol' from external module "c:/[redacted]/api/packages/client/node_modules/@tanstack/query-core/build/legacy/hydration-DiTAi-4H" but cannot be named.ts(4023)

I must admit I understand too little to pinpoint exactly what causes this issue, but it definitely prevents me from bundling this in my package. I am more than happy to be of guidance and provide more code snippets here. From what I found, this seems to stem from types being too complex to infer. If this is a case, is there a way to explicitly add type annotations during SDK-generation?

This is my current openapi-ts.config.ts

export default defineConfig({
	client: {
		name: '@hey-api/client-fetch'
	},
	experimentalParser: true,
	input: 'openapi-spec.json',
	output: 'packages/client/src',
	plugins: [
		...defaultPlugins,
		{
			name: '@tanstack/svelte-query'
		},
		{
			name: '@hey-api/schemas',
			type: 'json'
		}
	]
});

Reproducible example or configuration

No response

OpenAPI specification (optional)

No response

System information (optional)

No response

@Conceptiks Conceptiks added the bug 🔥 Something isn't working label Dec 20, 2024
@mrlubos
Copy link
Member

mrlubos commented Dec 20, 2024

Hey! Yeah I believe this has been requested before as a feature. Are you able to set up a StackBlitz example replicating the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🔥 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants