Skip to content

Unable to import fontkit's package.json in dependent packages #287

Open
@fstrube

Description

Packages that depend on fontkit are no longer able to obtain version information and other metadata by importing fontkit's package.json. Previously, we were able to do something like this:

const fontkitVersion = require('fontkit/package.json').version;

// or

import fontkitPackage from 'fontkit/package.json' assert {type: 'json'};

const fontkitVersion = fontkitPackage.version;

Now, we receive an ERR_PACKAGE_PATH_NOT_EXPORTED error when attempting to import the package.json file.

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './package.json' is not defined by "exports" 

Activity

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

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