Skip to content

Incompatible with gatsby-transformer-yaml and gatsby-transformer-json #19

@GabeMedrash

Description

@GabeMedrash

Thanks for this great plugin!

As I was attempting to transform the output of this plugin with gatsby-transformer-yaml, however, that transformer threw the following error: TypeError: Path must be a string. Received undefined. Fundamentally, it's because gatsby-transformer-yaml (as well as gatsby-transformer-json), attempt to set the type of the node it processes by reading the basename of a node.dir property. For reference, that happens here in the case of gatsby-transformer-json and here in the case of gatsby-transformer-yaml.

Instead of attempting to change the interface of a core transformer package, I figure the more appropriate compatibility change should happen here. I've created a PR that fixes this issue for your review. In that PR, I changed the name of the relativeDir key to dir, as they would otherwise be redundant (and therefore, this would be a breaking change). If you would rather this not be a breaking change, I'm happy to add dir in as an additional property and keep relativeDir.

Thanks in advance for considering the change!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions