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

Default export overwritten with export default null in uint8arrays package #238

Open
matheus23 opened this issue Nov 16, 2021 · 0 comments

Comments

@matheus23
Copy link

If you fetch https://cdn.skypack.dev/-/[email protected]/dist=es2019,mode=imports/optimized/uint8arrays.js

It returns:

export {compare} from "./uint8arrays/compare.js";
export {concat} from "./uint8arrays/concat.js";
export {equals} from "./uint8arrays/equals.js";
export {fromString} from "./uint8arrays/from-string.js";
export {toString} from "./uint8arrays/to-string.js";
export {xor} from "./uint8arrays/xor.js";
import "./common/bases-af280048.js";
import "/-/[email protected]/dist=es2019,mode=imports/optimized/multiformats/basics.js";
export default null;

Even though the original file contained this:

import { compare } from './compare.js';
import { concat } from './concat.js';
import { equals } from './equals.js';
import { fromString } from './from-string.js';
import { toString } from './to-string.js';
import { xor } from './xor.js';
export {
  compare,
  concat,
  equals,
  fromString,
  toString,
  xor
};

This turned out to be an issue for us because skypack auto-generated a default import in our ucans package:

From https://cdn.skypack.dev/-/[email protected]/dist=es2019,mode=imports/optimized/ucans.js:

import require$$0 from "/-/[email protected]/dist=es2019,mode=imports/optimized/uint8arrays.js";
import one_webcrypto_1 from "/-/[email protected]/dist=es2019,mode=imports/optimized/one-webcrypto.js";
import require$$1 from "/-/[email protected]/dist=es2019,mode=imports/optimized/tweetnacl.js";
[...]

(require$$1 works fine, but require$$0 is null)

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

1 participant