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

Fix @google/generative-ai/files paths #156

Merged
merged 4 commits into from
May 28, 2024
Merged

Fix @google/generative-ai/files paths #156

merged 4 commits into from
May 28, 2024

Conversation

hsubox76
Copy link
Collaborator

Fixes #155

This affects TypeScript users that are using "module: commonjs" or any other resolution that relies on the package.json in the files/ directory instead of on package.json exports.

"browser": "./dist/files/index.mjs",
"module": "./dist/files/index.mjs",
"typings": "./dist/files/files.d.ts"
"main": "../dist/files/index.js",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this break the module imports?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Module imports? I realized it might affect the rollup config as it gets paths from here, so I changed that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this with tsconfig set to module:commonjs, module:node16 and in a vite bundler proejct and it seems to work in all cases.

@hsubox76 hsubox76 marked this pull request as ready for review May 28, 2024 20:12
Copy link
Collaborator

@lahirumaramba lahirumaramba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@hsubox76 hsubox76 merged commit 42ba6ca into main May 28, 2024
4 checks passed
@hsubox76 hsubox76 deleted the ch-fix-paths branch May 28, 2024 20:26
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

Successfully merging this pull request may close these issues.

Cannot find module '@google/generative-ai/files' or its corresponding type declarations.
2 participants