fix(trpc): temp workaround for Node.js importing from CJS module issue#1436
Conversation
WalkthroughWalkthroughThis update modifies the import statement in the Changes
Assessment against linked issues
Possibly related issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (3)
packages/plugins/trpc/tests/projects/t3-trpc-v10/src/server/api/routers/generated/routers/Post.router.tsis excluded by!**/generated/**packages/plugins/trpc/tests/projects/t3-trpc-v10/src/server/api/routers/generated/routers/User.router.tsis excluded by!**/generated/**packages/plugins/trpc/tests/projects/t3-trpc-v10/src/server/api/routers/generated/routers/index.tsis excluded by!**/generated/**
Files selected for processing (1)
- packages/plugins/trpc/src/helpers.ts (1 hunks)
Additional comments not posted (1)
packages/plugins/trpc/src/helpers.ts (1)
240-245: Adjust import handling to support both default and named exports.The modification in the import handling within the
generateRouterSchemaImportfunction is a necessary workaround to address compatibility issues with CJS modules in Node.js. However, it would be beneficial to add a detailed comment explaining the use of(_Schema as any).defaultto aid future maintainability and understanding.
Fixes #1406