-
Notifications
You must be signed in to change notification settings - Fork 86
fix: try to resolve next modules via multiple paths #479
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
Conversation
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.
awesome!!!
my only thought is that maybe we should add consts that indicate that
next/dist/next-server/...
was < next 11.x (or whatever it was) and next/dist/server
is >= canary ?
const loadConfig = require(resolveNextModule( | ||
['next/dist/next-server/server/config', 'next/dist/server/config'], | ||
cwd, | ||
)).default |
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.
NICE
} | ||
} | ||
|
||
throw new Error(`Could not resolve Next module. Tried "${modules.join(', ')}"`) | ||
} |
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.
ez
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.
!
* Create e2e-report.yml * remove cli install * add secret + step for downlaod * remove commented out schedule * update
Next.js recently changed its directory structure, which broke our deep imports ( #475 ). This PR adds support to
resolveNextModule
for passing arrays of paths, to allow backward-compatible updates to paths like these. Meanwhile it also adds integration tests againstnext@canary
to make this less likely to happen. We also have plans to add automatic tests against new canary releases.Fixes #475