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

Unable to import in typescript project #23

Open
MarkShurmer opened this issue Jun 25, 2024 · 1 comment
Open

Unable to import in typescript project #23

MarkShurmer opened this issue Jun 25, 2024 · 1 comment

Comments

@MarkShurmer
Copy link

I've been trying to use your pgn parser from typescript, as it looks very good for parsing PGNs

I have a typescript project set up , using next.js and vitest

I am using ESM modules, so that shouldn't be a problem.

The error I get is:
Error: Failed to resolve entry for package "cm-pgn". The package may have incorrect main/module/exports specified in its package.json.

I wonder if it is due to the main section of your package.json being thus:
"main": "src/cm-pgn/Pgn.js"
When maybe it should be
"main": "src/Pgn.js"

I'm happy to create a PR

@shaack
Copy link
Owner

shaack commented Jun 25, 2024

Yes, this is wrong in the package.json. Would be great if you create a PR which makes it working with TypeScript. 👍 I am not 100% sure what the "main" entry in the package.json is for but "src/Pgn.js" seems to be the right setting for me. The folder "/cm-pgn" was deleted in former versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants