Skip to content

import from chart.js cause "cannot use import statement outside a module" #837

@echo178

Description

@echo178

Hello,
When I try to import annotation plugin at NodeJS as follows
import annotation from 'chartjs-plugin-annotation'
it is causing an error like below
annotation_bug

So What I have done to fix it is I downgrade to 2.0.0 and change chartjs-plugin-annotation.esm as follows

import { Element, defaults, Animations, Chart } from 'chart.js/auto' and everything work fines. (That fix doesn't work at ver 2.1.0)

annotation_bug_2

May I know what is wrong in here as I don't find similar issue mentioned or Is it only happening to me

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions