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

Incorrect 'module' Field and Missing 'types' Field in 'exports' Causing TypeScript Errors in ES Environment #57

Closed
zuhno opened this issue Dec 24, 2023 · 8 comments
Labels
bug Something isn't working need-reproducible

Comments

@zuhno
Copy link
Contributor

zuhno commented Dec 24, 2023

Describe the bug
When trying to import the 'vue3-google-signin' library in an ES environment, I encountered a type error indicating the absence of a declaration file for the module. The detailed error message is as follows:

Could not find a declaration file for module 'vue3-google-signin'. '/Users/junolee/Documents/mine/google-news-rss-pusher/node_modules/.pnpm/[email protected][email protected]/node_modules/vue3-google-signin/dist/index.es.js' implicitly has an 'any' type.
  There are types at '/Users/junolee/Documents/mine/google-news-rss-pusher/apps/@front/client/node_modules/vue3-google-signin/dist/plugin.d.ts', but this result could not be resolved when respecting package.json "exports". The 'vue3-google-signin' library may need to update its package.json or typings. ts(7016)

To Reproduce
Steps to reproduce the behavior:

  1. Set up a project with the 'vue3-google-signin' package.
  2. Attempt to import the package in an ES module environment.
  3. Observe the TypeScript error related to type declarations.

Reproducible Example
Currently, I do not have a reproducible example on platforms like StackBlitz or CodeSandbox. I will update this section if I am able to create one.

Expected behaviour
The expected behavior is for the module to be imported without any type errors, with TypeScript being able to find and use the declaration files correctly.

Additional context
To resolve this issue, the types field should be added under "exports" > "." in the package.json. Additionally, the module field is incorrectly pointing to a CJS module. It should instead specify the entry point for an ES module, typically using a .mjs or .js extension.

Contribution Proposal
I am considering contributing to the 'vue3-google-signin' library to address this issue. I would like to propose corrections to the package.json file, particularly adding the types field under "exports" > ".", and correcting the module field to accurately point to an ES module entry point. I wanted to inquire if contributing these changes would be appropriate.

@kasvith
Copy link
Collaborator

kasvith commented Dec 27, 2023

Hi @zuhno thanks for reporting the issue. you can create a pr if you like to contribute to the project

@kasvith kasvith added bug Something isn't working need-reproducible labels Dec 27, 2023
@zuhno
Copy link
Contributor Author

zuhno commented Dec 27, 2023

@kasvith I am interested in contributing, so I have opened a PR(#59). Please review it :)

@kasvith
Copy link
Collaborator

kasvith commented Dec 29, 2023

Closed by #59

@kasvith kasvith closed this as completed Dec 29, 2023
@coverrt
Copy link

coverrt commented Jan 4, 2024

@kasvith the latest release with #59 has not been published to npm yet.

@zuhno
Copy link
Contributor Author

zuhno commented Jan 4, 2024

@coverrt I have noted your comments as additional context in the issue(#60). Thank you for reminding again.

@kasvith
Copy link
Collaborator

kasvith commented Jan 15, 2024

Hi @zuhno can we get this fix on a separate PR?

@kasvith kasvith reopened this Jan 15, 2024
@zuhno
Copy link
Contributor Author

zuhno commented Jan 15, 2024

@kasvith Hi
I have submitted the PR(#62) for version 1.3.4. This is because version 1.3.3 has already been released.

@kasvith
Copy link
Collaborator

kasvith commented Apr 23, 2024

this should be fixed by now

@kasvith kasvith closed this as completed Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need-reproducible
Projects
None yet
Development

No branches or pull requests

3 participants