garrilla
garrilla

Reputation: 569

Unexpected token on 3rd part library

I'm trying to use a fork of the d3.js library d3-zoom-pan-extent

I have include the file d3-zoom-pan-extent.js in \client\lib to ensure its available.

The server reports application errors on build While building the application: client/lib/d3-zoom-pan-extent.js:2135:9: Unexpected token ?

Ordinarily, I would expect this to be a syntax issue, but I verified that d3-zoom-pan-extent.js works as expected in an Apache environment.

How can I get this library to run in my Meteor project?

Upvotes: 1

Views: 164

Answers (1)

musically_ut
musically_ut

Reputation: 34288

The fork of d3, just like d3 itself, should be served with the <meta charset="utf-8"> tag in the head or with the content-type header application/javascript;charset=utf-8.

Edit: In this case, the Meteor compiler couldn't build the script for delivery as the source file was wrongly encoded as ANSI. This produced the server error because the λ was stored as ? and thus the server was encountering the Unexpected token ?

Upvotes: 1

Related Questions