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

bundleSource emits a bundle when entrypoint does not exist #1206

Closed
kriskowal opened this issue Jun 4, 2022 · 2 comments · Fixed by #1671 · May be fixed by #1256
Closed

bundleSource emits a bundle when entrypoint does not exist #1206

kriskowal opened this issue Jun 4, 2022 · 2 comments · Fixed by #1671 · May be fixed by #1256
Assignees
Labels

Comments

@kriskowal
Copy link
Member

The following program should throw an error because bogus.js does not exist. Instead, it generates a bundle.

import '@endo/init';
import bundleSource from '@endo/bundle-source';
(async () => {
  const bundle = await bundleSource(new URL('bogus.js', import.meta.url).pathname);
  console.log(bundle);
})();
@warner
Copy link
Contributor

warner commented Feb 17, 2023

BTW the "empty" bundle this creates has only a compartment-map.json, no other components. The map has a .compartments with all the packages cited as dependencies of the the package that would have contained the (bogus) entry point. It also has a broken entry for the missing file:

        "microtime": {
          "compartment": "microtime-v3.1.0",
          "module": "./index"
        },
        "semver": {
          "compartment": "semver-v6.3.0",
          "module": "./semver.js"
        },
        "./bogus.js": {
          "deferredError": "Cannot find file for internal module \"./bogus.js\" (with candidates \"./bogus.js\") in package file:///home/node/agoric-sdk/packages/SwingSet/"
        }

The broken bundle has bundle.endoZipBase64.length === 11320, in case you're testing and looking to distinguish between functional bundles and broken ones.

@kriskowal
Copy link
Member Author

Coming soon to a release and integration near you.

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