-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
circular dependency (invalid esm) in v5 at /dist/es/Seq.js
and dist/es/Collection.js
#2019
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
Comments
building immutable with this patch at the 5.x branch gives me an es module that is working here diff --git a/resources/rollup-config.mjs b/resources/rollup-config.mjs
index bf32fc38..99c070b8 100644
--- a/resources/rollup-config.mjs
+++ b/resources/rollup-config.mjs
@@ -36,10 +36,8 @@ export default [
{
banner: copyright,
name: 'Immutable',
- dir: path.join(DIST_DIR, 'es'),
+ file: path.join(DIST_DIR, 'immutable.es.js'),
format: 'es',
- preserveModules: true,
- preserveModulesRoot: SRC_DIR,
sourcemap: false,
},
], |
I ran into this as well when upgrading from 4.3.7 to 5.0.0.
|
@kyle-leonhard do,you have a reproducible exemple? Can you provide your nodejs version and / or your bundler? |
@kyle-leonhard this should be resolved in 5.0.2 thanks to @iambumblehead |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Collection.js imports Seq.js and Seq.js imports Collection.js
Because circular dependencies aren't supported by esm, the files aren't usable as-is and must be transpiled.
Also, these lines in Seq.js look strange.
When Collection is imported through a circular dependency, its value is falsey
undefined
which causes a runtime error when it is passed toObject.create
related #1961
The text was updated successfully, but these errors were encountered: