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

With a circular dependency, TypeError: Cannot redefine property from the bundler #705

Closed
sompylasar opened this issue Apr 7, 2018 · 4 comments

Comments

@sompylasar
Copy link

https://codesandbox.io/s/61zjk5n05k?module=%2Fsrc%2Findex.js

TypeError: Cannot redefine property: a
    at Function.defineProperty (<anonymous>)
    at evaluate (https://61zjk5n05k.codesandbox.io/src/index.js:9:8)
    at r.a (https://codesandbox.io/static/js/sandbox.37512735.js:5359:971)
    at e.value (https://codesandbox.io/static/js/sandbox.37512735.js:5418:270)
    at https://codesandbox.io/static/js/sandbox.37512735.js:5391:22872
    at Array.forEach (<anonymous>)
    at e.value (https://codesandbox.io/static/js/sandbox.37512735.js:5391:22843)
    at https://codesandbox.io/static/js/sandbox.37512735.js:3877:8157
    at t (https://codesandbox.io/static/js/common-sandbox.a360099a.js:1937:811)
    at Generator._invoke (https://codesandbox.io/static/js/common-sandbox.a360099a.js:1937:599)
    at Generator.e.(anonymous function) [as next] (https://codesandbox.io/static/js/common-sandbox.a360099a.js:1937:990)
    at n (https://codesandbox.io/static/js/common-sandbox.a360099a.js:2110:316)
    at https://codesandbox.io/static/js/common-sandbox.a360099a.js:2110:412

screen shot 2018-04-07 at 2 10 05 pm

@CompuIves
Copy link
Member

CompuIves commented Apr 7, 2018 via email

@sompylasar
Copy link
Author

Yes, I expected a to be undefined, this sandbox is supposed to illustrate circular dependency issue, but stumbled upon this when I finished the code on desktop.

I'm on mobile (Android Chrome) now, too, and this sandbox is stuck on the loading screen.
screenshot_20180407-174246

@CompuIves
Copy link
Member

Hm weird, this is what I'm getting:

screen shot 2018-04-08 at 19 58 19

The earlier redefine error is certainly possible. We do Hot Module Replacement when you make changes, so in that case a.js could already have been evaluated before b.js was created. A full refresh should still give the a is undefined error though.

@lbogdan
Copy link
Contributor

lbogdan commented Mar 28, 2019

Closing this, as it's expected behavior. @sompylasar Feel free to reopen if you still have issues.

@lbogdan lbogdan closed this as completed Mar 28, 2019
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

3 participants