tomwanzek / d3-ng2-service

A D3 service for use with Angular.
MIT License
205 stars 42 forks source link

traceur 404 (Not Found) Error #110

Closed simianarmy closed 6 years ago

simianarmy commented 6 years ago

I am stuck with an Angular4 app that uses SystemJS and cannot get this package to load. My systemjs.config.js has what I have read are the correct settings for UMD:

map: "d3-ng2-service": "npm:d3-ng2-service"

packages:


"d3-ng2-service": {
main: "esm/index.js",
defaultExtension: "js"
}

and have followed the rest of the loading instructions for importing the code.
When the app loads the module with the import, I get the following errors:

> Error loading http://localhost:8000/traceur
>   Unable to load transpiler to transpile http://localhost:8000/node_modules/d3-ng2-service/esm/index.js
>   Error loading http://localhost:8000/node_modules/d3-ng2-service/esm/index.js as "d3-ng2-service" from http://localhost:8000/app/app.module.js
tomwanzek commented 6 years ago

@simianarmy I am sorry to say that in its current version the service is only exposed through ES2015 modules. There is no UMD format available, this is due to early issues I experienced with the live event-binding to d3.event, when I rolled it up into UMD.

So unless things have changed with SystemJS and newer version can natively handle ES2015 module format (like Webpack does), you would need to plug in a transpiler to use d3-ng2-service.

I am currently waiting until the dust settles on the toolchain for building Angular libraries (ng-packagr integration into angular-cli or the Bazel build ng-package) before I entertain a major refactoring/enhancement of this library.

Sorry, if this does not fully address your needs at this point. If you come up with a solution, please do not hesitate to let me know and I could see how to incorporate at least the guidance for others in your situation.

The problem I found with SystemJS-related questions in the past, is that they were always very setup specific. Did not lend themselves to generalizing...