Skip to content

Conversation

@naugtur
Copy link
Member

@naugtur naugtur commented Nov 4, 2025

some discrepancies I could find (less than expected, nesting seems mostly fine)

I'm not sure yet if I broke something, or i2.cjs identifies a bug. If it does, it seems like the cjs extension of the entrypoint is being treated with less priority than type field in package.json.

 file:///repo/endo/packages/compartment-mapper/test/fixtures-e2e-module-types/app/index.js:1
      ({imports:$h͏_imports,liveVar:$h͏_live,onceVar:$h͏_once,import:$h͏_import,importMeta:$h͏____meta})=>(function(){'use strict';$h͏_imports([]);const result = require('depth1');
                                                                                                                                                                  ^
      
      TypeError: require is not a function
          at eval (file:////repo/endo/packages/compartment-mapper/test/fixtures-e2e-module-types/app/index.js:1:157)
          at eval (file:///repo/endo/packages/compartment-mapper/test/fixtures-e2e-module-types/app/index.js:3:3)

It seems like nesting is barely useful here, but I'd consider keeping it as regression detection.


It'd be great to procedurally generate a virtual package tree and fuzz over all combinations of possible esm/cjs mixes

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

Successfully merging this pull request may close these issues.

2 participants