-
-
Notifications
You must be signed in to change notification settings - Fork 111
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
Upgrading to 2.0.1 results in 'return' outside of function error #78
Comments
This isn’t an error; top level returns are perfectly valid in a CJS module. Have you customized your CRA config at all? |
Hi @ljharb, I recall the project was a clean I upgrade packages once a week during development cycles with |
Indeed; v2 is the one that uses is-map/is-set, which have a top-level return. The issue is that something that's interacting with node-style CJS modules isn't supporting a decade-old feature of those modules. I'd be surprised if it was Webpack. |
eg, webpack/webpack#8509 is resolved, webpack/webpack#8510 is merged, released in webpack v4.31+. What version of webpack are you using? |
@ljharb, I'm not including webpack myself, but executing
|
Here is a simple set of steps to create a clean project that exhibits the anomaly:
Output:
|
The same issue... |
Looks like babel needs to have the |
@ljharb, I just recreated a clean
Are you saying you have to somehow modify a CRA install with |
Can we re-open this issue until there is a solution to use |
We could have, but you opened up #79 before i had a chance to. |
Sorry about that -- Thought we lost you already on this issue thread. Thank you for your efforts on this! Sincerely appreciated. Moving over to #79. |
Closes inspect-js/node-deep-equal#79. Closes inspect-js/node-deep-equal#78. Closes es-shims/Promise.allSettled#7. Closes airbnb/js-shims#12. Relates to: - inspect-js/is-map#5 - inspect-js/is-map#4 - inspect-js/is-map#3 - inspect-js/is-set#5 - inspect-js/is-set#4 - storybookjs/storybook#9154.
Closes inspect-js/node-deep-equal#79. Closes inspect-js/node-deep-equal#78. Closes es-shims/Promise.allSettled#7. Closes airbnb/js-shims#12. Relates to: - inspect-js/is-map#5 - inspect-js/is-map#4 - inspect-js/is-map#3 - inspect-js/is-set#5 - inspect-js/is-set#4 - storybookjs/storybook#9154.
It seems that upgrading to node-deep-equal 2.0.1 results in an error. I'm seeing other posts on this issue within the last few days against other projects, so it's unclear the true origin.
DOWNGRADING to
deep-equal 1.1.1
resolves the problem in my React (CRA) project.The text was updated successfully, but these errors were encountered: