Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

magika_node missing from exports in package.json #299

Open
pixartist opened this issue Mar 11, 2024 · 5 comments
Open

magika_node missing from exports in package.json #299

pixartist opened this issue Mar 11, 2024 · 5 comments
Labels
misdetection This issue is about a misdetection on a content type currently supported needs triage This issue still needs triage by one of the maintainers

Comments

@pixartist
Copy link

Currently this package is not usable in typescript via node as the node export is missing from the package.json

@pixartist pixartist added misdetection This issue is about a misdetection on a content type currently supported needs triage This issue still needs triage by one of the maintainers labels Mar 11, 2024
@pixartist
Copy link
Author

ps: the labels were automatically added and I cant remove them

@grant-d
Copy link

grant-d commented Mar 15, 2024

+1

@invernizzi
Copy link
Member

Extremely good point. It should be fixed now. Let me know if it looks good to you

@grant-d
Copy link

grant-d commented Mar 26, 2024

[edit - failed - see next comment]
Thanks @invernizzi
I can now import MagikaNode in the following style:

import { MagikaNode } from 'magika/dist/mjs/magika_node'

But the examples (even in the comments of file referenced above) show this style, which still doesn't work.
Not a problem per se, just FYI: (edit - see problem in next comment)

import { MagikaNode as Magika } from "magika"
image

@grant-d
Copy link

grant-d commented Mar 26, 2024

The 'path' import above works at lint-time, but fails at build-time due to ERR_PACKAGE_PATH_NOT_EXPORTED
The fix for that is to change the import to:

import { MagikaNode } from 'magika'

But that fails at lint-time (and maybe build-time) unless you change tsconfig to use node16 for module resolution, which breaks other package imports

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
misdetection This issue is about a misdetection on a content type currently supported needs triage This issue still needs triage by one of the maintainers
Projects
None yet
Development

No branches or pull requests

3 participants