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

@rspc/react MJS build isn't stripping out type-only exports #291

Closed
jedwards1211 opened this issue Jul 8, 2024 · 7 comments
Closed

@rspc/react MJS build isn't stripping out type-only exports #291

jedwards1211 opened this issue Jul 8, 2024 · 7 comments

Comments

@jedwards1211
Copy link

File: javascript/esm|/Users/andy/gh/battalion-webapp/frontend/node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@rspc/react/dist/index.mjs:1:1
  × HarmonyLinkingError: export 'BaseOptions' (reexported as 'BaseOptions') was not found in '@rspc/query-core' (possible exports: createRSPCQueryUtils)
     ╭─[217:1]
 217 │ }
 218 │ export {
 219 │   BaseOptions2 as BaseOptions,
     ·   ───────────────────────────
 220 │   createReactQueryHooks
 221 │ };
@oscartbeaumont
Copy link
Owner

oscartbeaumont commented Jul 9, 2024

Yeah this is definetly a know problem. Also reported here.

I had a quite look and couldn't reproduce the problem but I did fix some things reported by publint on 5e7c1ef (which are still unreleased but might help, idk)

@oscartbeaumont
Copy link
Owner

I tried to reproduce this with Twidge and another independant project and I could not. I am certain this is a problem given enough people have reported it but if you have the time can you make a minimum reproduction it would be great for me to be able to actually test fixes.

@oscartbeaumont
Copy link
Owner

Tagging @johann-crabnebula as I know they hit the same problem.

@jedwards1211
Copy link
Author

@oscartbeaumont reproducing depends on using a bundler/config that resolves to the .mjs files instead of the .js files.

In any case, using export type should fix the problem:

export type { BaseOptions } from "@rspc/query-core";

@oscartbeaumont
Copy link
Owner

Okay this is published as 0.2.2 of the respective packages. Let me know if it fixes the problem!

@johann-crabnebula
Copy link

Will have a look later today

@jedwards1211
Copy link
Author

@oscartbeaumont yup it fixed the problem for me!

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

No branches or pull requests

3 participants