question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ESM incompatibility due to round-to (direct dependency)

See original GitHub issue

First of all thank you for providing and esm export but unfortunately it’s not working as expected because round-to (a direct dependency) isn’t an esm module itself.

Error:

SyntaxError: Importing binding name 'default' cannot be resolved by star export entries.

See reproduction here (capsize): https://esm.codes/#aW1wb3J0IGNhcHNpemUgZnJvbSAnaHR0cHM6Ly91bnBrZy5jb20vY2Fwc2l6ZSc7Cgpjb25zdCBzdHlsZXMgPSBjYXBzaXplKHsKICBjYXBIZWlnaHQ6IDE2LAogIGxpbmVHYXA6IDgsCiAgZm9udE1ldHJpY3M6IHsKICAgIGNhcEhlaWdodDogNzAwLAogICAgYXNjZW50OiAxMDU4LAogICAgZGVzY2VudDogLTI5MSwKICAgIGxpbmVHYXA6IDAsCiAgICB1bml0c1BlckVtOiAxMDAwLAogIH0sCn0pOwoKY29uc29sZS5sb2coInN0eWxlczogIiwgc3R5bGVzKTs=

or

import capsize from 'https://unpkg.com/capsize';

const styles = capsize({
  capHeight: 16,
  lineGap: 8,
  fontMetrics: {
    capHeight: 700,
    ascent: 1058,
    descent: -291,
    lineGap: 0,
    unitsPerEm: 1000,
  },
});

console.log("styles: ", styles);

See reproduction here (round-to): https://esm.codes/#aW1wb3J0IHJvdW5kVG8gZnJvbSAnaHR0cHM6Ly91bnBrZy5jb20vcm91bmQtdG8nOwoKY29uc29sZS5sb2coInJvdW5kOiAiLCByb3VuZFRvKDEuMjM0LCAyKSk7

or

import roundTo from 'https://unpkg.com/round-to';

console.log("round: ", roundTo(1.234, 2));

Be careful not to use a cdn like cdn.skypack.dev it will look like it’s working because they magically translate non esm module into esm module on the fly, see here:

https://esm.codes/#aW1wb3J0IHJvdW5kVG8gZnJvbSAnaHR0cHM6Ly9jZG4uc2t5cGFjay5kZXYvcm91bmQtdG8nOwoKY29uc29sZS5sb2coInJvdW5kOiAiLCByb3VuZFRvKDEuMjM0LCAyKSk7

or

import roundTo from 'https://cdn.skypack.dev/round-to';

console.log("round: ", roundTo(1.234, 2));

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
michaeltarantocommented, Mar 15, 2021

Resolved by #33

2reactions
michaeltarantocommented, Mar 9, 2021

Will be removing the dependency in favour of internalising the function as part of an upcoming PR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · seek-oss/capsize - GitHub
ESM incompatibility due to round-to (direct dependency). #30 opened on Jan 24, 2021 by sync · 6. ProTip! Adding no:label will show everything...
Read more >
Anthony Mittaz on Twitter: "@michaeltaranto But could be even ...
First of all thank you for providing and esm export but unfortunately it's not working as expected because round-to (a direct dependency) isn't...
Read more >
751 PART 15—RADIO FREQUENCY DEVICES - GovInfo
the-air due to radiation of the radio frequency signals from the electric power lines (intentional radiator). (g) CB receiver. Any receiver that op-....
Read more >
DoDM 4145.26, March 13, 2008, Incorporating Change 2 ...
(a) DoD Directive 6055.09E, “Explosives Safety Management (ESM),” ... The contracting officer may direct a different time period for the.
Read more >
IBM CICS Transaction Server for z/OS, V5.6 delivers ...
This can be linked to from COBOL or any other language using the CICS ... components in addition to the external security manager...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found