Closed martaver closed 4 years ago
The line that fails is the export:
eval("module.exports = Chart;\n\n//# sourceURL=webpack:///external_%22Chart%22?");
Ahhhh got it!
Brain fart... I'm using nextjs and it was looking for the Chart instance during serverside render, probably on window (which didn't exist).
Thanks :D
That's good to now! I had a similar issue when trying to use the plugin in an Observable, where it silently failed to load due to a the missing window.Chart
object... Anyway good you found it!
@martaver I am wondering how did you get this to work with NextJS? I have been trying to link the plugin to the react-chartjs-2
but it's not working. Can you please provide what extra code did you write specific to NextJS that helped connecting the plugin to the package?
Do we have a solution on how to use with nextjs? @chrispahm @ylkhayat @martaver
I'm trying to set this plugin up with react-chartjs-2, according to your demo.
I read your Gotchas section, which shows that I have to import
chartjs-plugin-dragdata
.But when I do that I just get:
My import code:
Using version
chartjs-plugin-dragdata@1.1.3
,chart.js@2.6.0
(as per demo) andreact-chartjs-2@2.1.0
(also as per demo).Without trying to import
chartjs-plugin-dragdata
, my Line chart renders fine (just not draggable, obviously).Any idea what might be going on?