Skip to content
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

“addDefaultProperty” may cause circular reference problem #78

Open
SteinNs opened this issue May 6, 2019 · 4 comments
Open

“addDefaultProperty” may cause circular reference problem #78

SteinNs opened this issue May 6, 2019 · 4 comments

Comments

@SteinNs
Copy link

SteinNs commented May 6, 2019

If I set "addDefaultProperty" to true,
module.exports = exports['default']; module.exports.default = exports['default'] will be added, which means module.exports.default may circular reference itself.
It will lead to circular reference problem when I try to JSON.stringify(module.exports).

@ljharb
Copy link

ljharb commented May 6, 2019

Why would you be json stringifying a module? o.O

@SteinNs
Copy link
Author

SteinNs commented May 7, 2019

Why would you be json stringifying a module? o.O

Emm,I think Redux/React did sth like this
You must pass a component to the function returned by " + b + ". Instead received " + JSON.stringify(i)

@ljharb
Copy link

ljharb commented May 7, 2019

Fair enough :-)

At any rate, it’s a necessary part of this transform - require has to bring in the default, but .default on it has to be the default too. In other words, I’d file an issue on prop-types for relying on something that’s unsafe with cycles for the error message :-)

@SteinNs
Copy link
Author

SteinNs commented May 9, 2019

xD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants