nicolaskruchten / pivottable

Open-source Javascript Pivot Table (aka Pivot Grid, Pivot Chart, Cross-Tab) implementation with drag'n'drop.
https://pivottable.js.org/
MIT License
4.36k stars 1.08k forks source link

Gulp crashes on Windows 10 #1047

Open bseddon opened 5 years ago

bseddon commented 5 years ago

To create an alternative UI I wanted to update the CoffeeScript but found that when I ran Gulp to regenerate the dist file Gulp crashed. This is using Node 10.13.0 and NPM 6.4.1 on Windows 10.

The cause is that the version of gulp-git referenced in package.json references a version of require-dir that uses the 'hasOwnProperty' property. This property is no longer available in node.js (was deprecated in version 2.x and removed in version 8.x).

The solution for me has been to update the version of gulp-git from 0.5.5 to 2.8.0 in package.json. The later version of gulp-git still references the require-dir plugin but references version 1.0.0 which does not use the invalid property.

After making this change and removing the node-modules folder then running 'npm install' again everything works as expected and the dist files are updated successfully.

Having never used node.js or npm or gulp before, it took an hour or so to understand how to interpret the error messages to workout how to avoid the crash. Maybe this note will help someone else avoid the crash more quickly.

nicolaskruchten commented 5 years ago

Ah, sorry about this. The whole gulp thing is pretty old and creaky at this point and could stand to be replaced by a much leaner and easier pipeline. I can't even get it to work on my machine without downgrading node to v6 with nvm :(

bseddon commented 5 years ago

Sometimes people pay complements to an author to curry favour so I want you to know my thanks for your work to create the pivot table project are heart felt. I am creating an app that presents lots of multi-dimensional data and being able to use this project to provide users with either a fixed or interactive view of the data is fantastic. And it is by far the most finished pivot table type tool for web pages I have been able to find.

In my haste I forgot that I also installed the 'natives' package (npm i natives) to workaround another crash that emits this message:

gulp[16200]: src\node_contextify.cc:628: Assertion `args[1]->IsString()' failed.

The need to explicitly install the natives package can be accommodated by adding this line to package.json:

"natives": "^1.1.6"

Again, removing the 'node-modules' folder then running npm install fixes the issue.

I saw you wrote that you have stayed at node 6.x. With these two changes the chain seems to work OK with node 10.x. I see the same success results (and failure) when opening the index page in the tests folder.

I imagine you are enjoying work with react.js now. Alas, my use of the pivot table is in a WordPress context and adding react seems in appropriate given I don't then get any additional functionality (that I want). I also want to use the subtotal classes which are not available in the react version (so far as I know).

nicolaskruchten commented 5 years ago

Hmm what failure do you see in the tests? I actually just realized that I see nothing in the tests page, which is a problem in and of itself!

PS: you're welcome, and I'm glad you're finding this tool useful! The React version is quite fun to play with also but I'm maintaining both simultaneously, and there are a bunch of things like subtotals and localization which aren't supported by the React version (yet) as you say.

bseddon commented 5 years ago

Here's a text presentation of the page generated by ./tests/index.html when on the 'failures' tab. I see this output after downloading the project zip and before running gulp. I see the same output after running gulp. I assumed this is correct (sometimes a failure is the positive result).

finished in 1.457s 67 specs, 1 failure Spec List | Failures $.pivotUtilities .aggregatorTemplates .listUnique works Expected 'female,male' to be 'male,female'. Error: Expected 'female,male' to be 'male,female'. at stack (https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.4.1/jasmine.js:1577:17) at buildExpectationResult (https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.4.1/jasmine.js:1547:14) at Spec.expectationResultFactory (https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.4.1/jasmine.js:638:18) at Spec.addExpectationResult (https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.4.1/jasmine.js:330:34) at Expectation.addExpectationResult (https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.4.1/jasmine.js:588:21) at Expectation.toBe (https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.4.1/jasmine.js:1501:12) at Object. (file:///C:/Users/Bill/Downloads/pivottable-master/dist/pivot_spec.js:405:63) at attemptSync (https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.4.1/jasmine.js:1886:24) at QueueRunner.run (https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.4.1/jasmine.js:1874:9) at QueueRunner.execute (https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.4.1/jasmine.js:1859:10)