-
-
Notifications
You must be signed in to change notification settings - Fork 88
Description
There seems to be an issue with babel/d3-array in fresh Windows installs. After creating an idyll article (and probably other types), trying to run idyll results in an unhandled error. This not an issue with idyll itself per se but may be impacting idyll users.
To Reproduce
Steps to reproduce the behavior:
- Download and install node.js from https://nodejs.org/en/download/
- Open a Node.js command prompt and update npm to the latest (8.6.0) -
npm install -g npm@latest npm install -g idyllidyll create(use the defaults)cd my-idyll-postidyll
An error is thrown -
Building Idyll project with output directory: build
[BABEL] Note: The code generator has deoptimised the styling of "C:/Users/Kay/idyll/idyll-helloworld/node_modules/react-dom/cjs/react-dom.development.js" as it exceeds the max of "500KB".
node:events:504
throw er; // Unhandled 'error' event
^
SyntaxError: C:/Users/Kay/idyll/idyll-helloworld/node_modules/d3-array/dist/d3-array.js: Only '=' operator can be used for specifying default value. (139:15)
137 | var sum = 0, index = 0;
138 | return Float64Array.from(values, valueof === undefined
> 139 | ? v => (sum += +v || 0)
| ^
140 | : v => (sum += +valueof(v, index++, values) || 0));
141 | }
142 |
Environment
- OS: Microsoft Windows 10
- [email protected]
- [email protected], [email protected]
I had newly reformatted Windows 10 just a week or so ago, so it's a pretty clean environment. Idyll is being used for a class I'm attending, and about five of us in the class (all on Windows 10) ran into this same issue.
Installing the same in a new Ubuntu virtual machine does not throw an error. d3-array and babel (and idyll) versions were the same.
Additional context
As discussed in babel/babel#11038, updating cumsum in d3-array.js to use the function below instead is a workaround -
function cumsum(values, valueof) {
var sum = 0,
index = 0
return Float64Array.from(
values,
valueof === undefined
? function (v) {
return (sum += +v || 0)
}
: function (v) {
return (sum += +valueof(v, index++, values) || 0)
}
)
}
Relevant links: