-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
refactor(framework): Make discovery completely asynchronous #6879
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
❌ Deploy Preview for novu-stg-vite-dashboard-poc failed. Why did it fail? →
|
rifont
commented
Nov 7, 2024
try { | ||
// eslint-disable-next-line global-require | ||
const { zodToJsonSchema } = require('zod-to-json-schema') as typeof import('zod-to-json-schema'); | ||
const { zodToJsonSchema } = await import('zod-to-json-schema'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Begone, dynamic require
!
SokratisVidros
approved these changes
Nov 7, 2024
commit: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changed? Why was the change needed?
await import(...)
) of peer dependencies to provide an optimal DX, where no manual dependency injection is required.prettyPrintDiscovery
to theclient
. This also lays the groundwork for making the pretty discovery use a custom loggerScreenshots
next dev --turbopack
compatibility is a step closer now, erroring out withmodule not found
rather than the previousrequire
polyfill error.Some further investigation is to identify the root cause for the new problem. Judging by the docs at https://nextjs.org/docs/messages/module-not-found, it's probably:The module you're trying to import uses Node.js specific modules, for example dns, outside of getStaticProps / getStaticPaths / getServerSideProps
. Here is the current usage ofnode
built-in modules (node:crypto
is used at runtime for HMAC header validation,node:util/types
is used for an error type guard).Expand for optional sections
Related enterprise PR
Special notes for your reviewer