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

JsonFunction not exported from remix-node as type #4375

Closed
SeanLatimer opened this issue Oct 17, 2022 · 7 comments
Closed

JsonFunction not exported from remix-node as type #4375

SeanLatimer opened this issue Oct 17, 2022 · 7 comments

Comments

@SeanLatimer
Copy link

What version of Remix are you using?

1.7.2

Steps to Reproduce

npm install @remix-run/node

Expected Behavior

JsonFunction should be exported as a type from @remix-run/node

Actual Behavior

As you can see here remix-node/index.ts#L44, JsonFunction is not exported as a type.

@machour
Copy link
Collaborator

machour commented Oct 18, 2022

Out of curiosity: What's your use case for having it exported?

@SeanLatimer
Copy link
Author

I personally don't need it exported. The fact that it's a type not being exported as a type is causing TypeScript errors with some code generation from rmx-cli that re-exports some stuff from remix packages.

@machour
Copy link
Collaborator

machour commented Oct 18, 2022

@kiliman would it make sense to have it exported?

@kiliman
Copy link
Collaborator

kiliman commented Oct 18, 2022

I see. The issue is that Remix is exporting JsonFunction, but it's not exporting as a type. That's why you get a warning with the generator since it creates separate re-exports for types and non-types. That should just be moved to the export type block.

export {
createRequestHandler,
createSession,
isCookie,
isSession,
json,
JsonFunction,
MaxPartSizeExceededError,
redirect,
unstable_composeUploadHandlers,
unstable_createMemoryUploadHandler,
unstable_parseMultipartFormData,
} from "@remix-run/server-runtime";

@pcattori
Copy link
Contributor

Fixed by #5204

@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version v0.0.0-nightly-8346ace-20230124 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version 1.12.0 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

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

No branches or pull requests

4 participants