standard-things / esm

Tomorrow's ECMAScript modules today!
Other
5.26k stars 146 forks source link

Migration from @std/esm to esm #864

Open gigouni opened 4 years ago

gigouni commented 4 years ago

Hi,

I'm facing issue while migrating from @std/esm to esm. I saw the post (https://github.com/standard-things/esm/issues/668) but I don't get it.

We're not using .mjs but we need __dirname and import CJS internal modules. @std/esm is deprecated so we're migrated but I cannot find the matching options.

Environment

More details

Attempts

SyntaxError: The requested module '<path/to/project>/node_modules/<internal-module-name>/dist/index.js' does not provide an export named 'default'

while it is

  "esm": {
    "cjs": {
      "cache": true,
      "esModule": true,
      "namedExports": true
    },
    "mode": "auto",
    "debug": true
  },

But still having issue with another previousliy working file

SyntaxError: The requested module '<path/to/project>/node_modules/<another-internal-module-name>/dist/index.js' does not provide an export named 'default'

Any ideas would be appreciate.

P.S.: I already saw other posts like this one, this one and even this one but I don't get the answer P.P.S: your response time is pretty impressive @jdalton , your work too