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
fix(core): require.resolve(m/package.json) is not guarunteed to work for modern module format #10497
fix(core): require.resolve(m/package.json) is not guarunteed to work for modern module format #10497
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
d06f7bc
to
4d9ed07
Compare
const packageJson = readJsonFile(packageJsonPath); | ||
|
||
if (!(packageJson.name === moduleSpecifier)) { | ||
throw new Error( |
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.
This happens?
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.
This shouldn't happen. This would occur if for some reason require.resolve(packageName
) pointed to a folder that didn't have a moduleName. Its a safety guard, but thats it.
4d9ed07
to
5e77f13
Compare
5e77f13
to
4bcfeac
Compare
4bcfeac
to
39ed34e
Compare
d0d952f
to
9d780fc
Compare
9d780fc
to
161d63e
Compare
161d63e
to
02b2c29
Compare
02b2c29
to
1ec8e46
Compare
1ec8e46
to
09db34b
Compare
09db34b
to
8ecb974
Compare
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
Packages that use
exports
inpackage.json
cause errors during migrationExpected Behavior
We are able to resolve the package.json location regardless of module format
Related Issue(s)
Fixes #