I'm assuming you used the file in the src directory. This isn't a regular javascript file, it's node. Luckily the author is buidling what looks to be a web safe version in the dist folder. That version is minified, uglified, and ran through babel.

You rarely want to include files from src or files that aren't uglified. That will cause your webpage to load extra white space data that it does not need.


The exact file that you have linked, d3_timeseries.js, is not written in such a way that it can be used, without processing, in a browser.

Its very first line import * as d3 from "d3"; will fail, no matter what browser, because "d3" is not a URL that can be evaluated correctly from a browser context. It is not a relative URL, it is not a

It looks like it is intended to be utilized by webpack or some other script bundler. If you used this in a webpack context to bundle your code, it would load "d3" from node_modules.

I know that you said that you "don't want to use min files", so your options are either compile your own bundle or just use the min files in the /dist folder.

Related Query

More Query from same tag