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

The engine "pnpm" appears to be invalid. #11214

Closed
Aaqu opened this issue Mar 30, 2023 · 26 comments
Closed

The engine "pnpm" appears to be invalid. #11214

Aaqu opened this issue Mar 30, 2023 · 26 comments

Comments

@Aaqu
Copy link

Aaqu commented Mar 30, 2023

Expected behavior

no warning

Current behavior

warning chart.js@4.2.1: The engine "pnpm" appears to be invalid.

image

Reproducible sample

main

Optional extra steps/info to reproduce

yarn add chart.js

Possible solution

No response

Context

When yarn Fetching packages... return warning

chart.js version

v4.2.1

Browser name and version

No response

Link to your project

No response

@Aaqu Aaqu added the type: bug label Mar 30, 2023
@re-thc
Copy link

re-thc commented Mar 30, 2023

Which version of ppm are you using? Might be the same as #11208?

@Aaqu
Copy link
Author

Aaqu commented Mar 30, 2023

Which version of ppm are you using? Might be the same as #11208?

I use yarn, v1.22.19 in next.js project, node v16.15.0. I don't use pnpm directly

@Aaqu
Copy link
Author

Aaqu commented Mar 30, 2023

same problem on codesandbox, doesn't look like a local problem

image

@LeeLenaleee
Copy link
Collaborator

Seems you need to use V2 of yarn, its a wont fix in yarn

yarnpkg/yarn#7560 (comment)

@ashutosh887
Copy link

How to solve this issue?

 chart.js@4.2.1: The engine "pnpm" appears to be invalid.

I'm also using yarn
@LeeLenaleee @Aaqu @re-thc @bakert

@mikesiiro
Copy link

Which version of ppm are you using? Might be the same as #11208?

I use yarn, v1.22.19 in next.js project, node v16.15.0. I don't use pnpm directly

Same problem, I don't use pnpm directly, this "warning chart.js@4.2.1: The engine "pnpm" appears to be invalid." was in my GitLab pipeline.

@Demir-Utku
Copy link
Contributor

Ones who use pnpm@8.x.x, this warning will be fixed probably in the next release.

@kristjanmar
Copy link

This error is preventing me from being able to deploy my project to Vercel. Is there a workaround?

image

@Aaqu
Copy link
Author

Aaqu commented Apr 13, 2023

This error is preventing me from being able to deploy my project to Vercel. Is there a workaround?

image

Can you try force version 7.x.x pnpm? https://vercel.com/docs/concepts/deployments/configure-a-build

@LeeLenaleee
Copy link
Collaborator

LeeLenaleee commented Apr 13, 2023

This will be fixed in V4.3.0

#11209

Workaround is to install the master branch instead of a package version untill it is released
https://stackoverflow.com/questions/39732397/install-specific-branch-from-github-using-npm

@yadoga
Copy link

yadoga commented Apr 17, 2023

Tried installing the master branch specifically (in a SvelteKit / Vite app):

pnpm i -D https://github.com/chartjs/Chart.js#master

Results in this error:

[plugin:vite:import-analysis] Failed to resolve entry for package "chart.js".
The package may have incorrect main/module/exports specified in its package.json.

@Demir-Utku
Copy link
Contributor

Tried installing the master branch specifically (in a SvelteKit / Vite app):

pnpm i -D https://github.com/chartjs/Chart.js#master

Results in this error:

[plugin:vite:import-analysis] Failed to resolve entry for package "chart.js".
The package may have incorrect main/module/exports specified in its package.json.

You installed the package as a dev dependency, could you try installing in this way:

pnpm add https://github.com/chartjs/Chart.js#master

@yadoga
Copy link

yadoga commented Apr 18, 2023

Thanks. The module export error is persisting, unfortunately.

@SilvesterCat73
Copy link

Thanks. The module export error is persisting, unfortunately.

Same here. After installing chart.js through:

pnpm add https://github.com/chartjs/Chart.js#master

I get the dependency in package.json:
CleanShot 2023-04-18 at 20 04 44

but once I try to run my project (sveltekit) I get the infamous error:
CleanShot 2023-04-18 at 20 02 23

@SilvesterCat73
Copy link

I realised that

pnpm add https://github.com/chartjs/Chart.js#master

installs the master branch as is (without the dist folder).

I installed chart,js in a separate folder (as mentioned in the chart.js installation instructions from Github)
CleanShot 2023-04-18 at 20 51 09
and built the project. I then copied the dist folder in my project node_modules/chart.js folder and now it seems to work.

@yadoga
Copy link

yadoga commented Apr 18, 2023

I guess that would be necessary as a manual copy-over on a production server as well then?

Would not mind an intermediate package release à la 4.2.5 or something… Would be a quick solution for this bug, as the source looks ready for it. @LeeLenaleee

@ZetiMente
Copy link

ZetiMente commented Apr 27, 2023

https://stackoverflow.com/questions/39732397/install-specific-branch-from-github-using-npm

This issue is fixed from a PR that was done a month ago. Why can't you do a 0.0.1 release just to fix this bug? The issue is just changing the package.json engine from ^7.0.0 to >= 7.0.0. It's really causing a lot of people headaches over something already fixed.

@ZetiMente
Copy link

Hi @etimberg

Do you think you could do a hotfix release to fix this simple issue? (But yet causes a lot of problems)

#11209

It's been over a month since this was fixed.

@etimberg
Copy link
Member

@ZetiMente sorry about this, I don't have a ton of time to spend on opensource at the moment. I've sent the version bump PR #11257 which would be the final step before a release.

@LeeLenaleee
Copy link
Collaborator

4.3 is released

https://github.com/chartjs/Chart.js/releases/tag/v4.3.0

@Aaqu
Copy link
Author

Aaqu commented Apr 28, 2023

yarn remove chart.js and yarn add chart.js am i still doing something wrong?
image

@LeeLenaleee
Copy link
Collaborator

Its only a warning, but you get that warning because you are using yarn V1 and need to use V2

#11214 (comment)

@Aaqu
Copy link
Author

Aaqu commented Apr 28, 2023

Its only a warning, but you get that warning because you are using yarn V1 and need to use V2

#11214 (comment)

Why other modules don't have warning in V1? I can't understand this

I don't know if it applies here, Vercel enforces V1 for full support https://vercel.com/guides/does-vercel-support-yarn-2

@LeeLenaleee
Copy link
Collaborator

They don't have the warning because they don't use pnpm then, instead they use yarn, npm or something else.

Apart from the warning it should work fine. As seen in my comment i linked yarn marked it as a no fix for V1 so you will have to keep the warning or update to yarn 2

@leoplct
Copy link

leoplct commented Oct 18, 2023

Upgrading Yarn solved it for me.

yarn set version stable
yarn install

@LeeLenaleee
Copy link
Collaborator

Issue is fixed in #11209

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

No branches or pull requests