-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
commonjs nested re-exports are broken #41422
Comments
Here's a repro. This seems unlikely to be common outside prettier, but we still need to get this working for 4.1: // @filename: forever.js
const hardline = { type: "Hard" }
module.exports = { hardline }
// @filename: mod1.js
module.exports = {
nested: require('./forever')
}
// @filename: test.js
const { hardline } = require('./mod1').nested
hardline Notably, there's only an error on the second use of |
Fixes resolution of export aliases in the postfix-property-access case of commonjs require: ```js const { x } = require('./foo').nested x ``` This program would previously fail if `x` was an export alias. Fixes #41422
Fixes resolution of export aliases in the postfix-property-access case of commonjs require: ```js const { x } = require('./foo').nested x ``` This program would previously fail if `x` was an export alias. Fixes #41422
Fixes resolution of export aliases in the postfix-property-access case of commonjs require: ```js const { x } = require('./foo').nested x ``` This program would previously fail if `x` was an export alias. Fixes microsoft#41422
Fixes resolution of export aliases in the postfix-property-access case of commonjs require: ```js const { x } = require('./foo').nested x ``` This program would previously fail if `x` was an export alias. Fixes #41422 Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
User tests compile with quite a few errors again. I haven't confirmed that this is the case on release-4.1, but I expect it is.
Follow-on to #40578, very likely a result of the PR that fixed that, plus the recent improvement to commonjs export aliasing.
The text was updated successfully, but these errors were encountered: