Visitar URL original
Re-add default export for v5 esm · Issue #770 · nodeca/js-yaml · GitHub
Skip to content

Re-add default export for v5 esm #770

Closed

Description

@rlindner81

In v4 you could

import yaml from "js-yaml";

Now the default export from
https://github.com/nodeca/js-yaml/blob/v4/lib/index_vite_proxy.tmp.mjs#L37

is gone... and all our pipelines are failing.

SyntaxError: The requested module 'js-yaml' does not provide an export named 'default'

I read the v5 changelog and migration guide, but I feel neither addresses why this common pattern was dropped. I feel you coud still have a default export with the most broadly used functionality available.

Activity

  1. puzrin commented on Jun 24, 2026

    @puzrin
    Member

    I guess, you can do import * as yaml from js-yaml. I'm not sure double exports are a good idea.

  2. added a commit that references this issue on Jun 24, 2026
    89024c4
  3. rlindner81 commented on Jun 24, 2026

    @rlindner81
    Author

    I guess, you can do import * as yaml from js-yaml. I'm not sure double exports are a good idea.

    The issue is not for code that I can change, it's one of our dependencies that does the importing... I do see your point regarding double exports.

    A major version change is the best place for you to introduce this change from having a default export to having none. It would still be good to acknowledge it in the changelog/migration guide.

  4. puzrin commented on Jun 24, 2026

    @puzrin
    Member

    See 89024c4, already done. But I sit on the other side and may miss something about "how users see the situation". If you think the docs can be improved further, suggest a PR. Sorry for the friction, but that's an essential part of any big major release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions