-
Notifications
You must be signed in to change notification settings - Fork 322
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
Server Error when using annotation plugin with Chart.js 4.0.1 in NextJS app #814
Comments
@kurkle @LeeLenaleee I'm not so familiar with packaging but I have the feeling we should change |
I think there is the same issue on zoom plugin: https://stackoverflow.com/questions/74623256/error-err-package-path-not-exported-no-exports-main-defined-in-d-node-e-mo |
I'm new to Javascript but I needed this library for a project of mine, so I tried stockiNail's suggestion and matched the
|
@TraceLosu thank you very much for testing with About the issue related to |
Weird, I still have the
I may have installed it incorrectly? |
it's really weird. Here is my
I'm going to publish the project as soon as I have time. |
@TraceLosu apologize for delay but I was busy. I have published my test NextJS project: https://github.com/stockiNail/testnext After Then |
I've been using the changes from the PR of @stockiNail with success using the following patch file for patch-package: diff --git a/node_modules/chartjs-plugin-annotation/package.json b/node_modules/chartjs-plugin-annotation/package.json
index f7b8c12..45e3d9d 100644
--- a/node_modules/chartjs-plugin-annotation/package.json
+++ b/node_modules/chartjs-plugin-annotation/package.json
@@ -5,8 +5,15 @@
"version": "2.1.0",
"author": "Evert Timberg <[email protected]>",
"license": "MIT",
- "main": "dist/chartjs-plugin-annotation.js",
- "module": "dist/chartjs-plugin-annotation.esm.js",
+ "type": "module",
+ "main": "dist/chartjs-plugin-annotation.esm.js",
+ "jsdelivr": "dist/chartjs-plugin-annotation.min.js",
+ "unpkg": "dist/chartjs-plugin-annotation.min.js",
+ "exports": {
+ "types": "./types/index.d.ts",
+ "import": "./dist/chartjs-plugin-annotation.esm.js",
+ "require": "./dist/chartjs-plugin-annotation.min.js"
+ },
"types": "types/index.d.ts",
"repository": {
"type": "git", Don't forget to remove the |
Yup, works fine now. I did the same method of installing the PR to my project and it's also working fine. Thank you very much! |
@TraceLosu @fdev @ferremekelenkamp with Chartjs 4.1.1, the PR of this plugin is not needed anymore therefore it works with Annotation 2.1.0. If you can test and give us a feedback. |
Tested it with [email protected] and [email protected], works perfectly fine with box and line annotations! |
Closed as completed via #838. |
Hey guys,
First of all, thanks for making this super helpful library!
I am currently working on a NextJS and have implemented ChartJS v4.0.1. All works well, but when I want to install the annotation plugin and follow the steps of https://www.chartjs.org/chartjs-plugin-annotation/latest/guide/integration.html I get the following error:
My React component is: (only relevant is shown)
Do you guys have any idea how to solve this? Is it an issue because of ChartJS v4?
Thanks a lot!
Cheers,
Ferre
The text was updated successfully, but these errors were encountered: