Skip to content

Commit

Permalink
fix: export premature close error (#480)
Browse files Browse the repository at this point in the history
  • Loading branch information
npaton committed Jan 1, 2024
1 parent b32b95a commit cd48506
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 17 deletions.
15 changes: 15 additions & 0 deletions .changeset/export-premature-close.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
"@empirica/core": patch
---

`empirica export` could fail with a "Premature close" error (#474). This seems
to be originating from a bug in the `node-fetch` package, which is used to
polyfill `fetch` in Node.js. This upgrades Node.js to v20+, which includes
native `fetch` support. We still have the `cross-fetch` polyfill for projects
that have not updated to Node.js v20+ yet. Export uses a vendored project which
has been updated to use the latest Node.js version, so it does not require the
entire experiment to be updated for it to use Node.js v20+.

See the following issues on `node-fetch` for more details:
https://github.com/node-fetch/node-fetch/issues/1767
https://github.com/node-fetch/node-fetch/issues/1576
4 changes: 2 additions & 2 deletions .github/actions/upload-empirica-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"author": "Nicolas Paton",
"private": true,
"volta": {
"node": "16.17.0",
"npm": "8.15.0"
"node": "20.10.0",
"npm": "10.2.3"
},
"dependencies": {
"@actions/core": "1.10.0",
Expand Down
4 changes: 2 additions & 2 deletions internal/templates/source/callbacks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"serve": "node --trace-warnings --enable-source-maps --unhandled-rejections=warn-with-error-code index.js"
},
"volta": {
"node": "16.17.0",
"npm": "8.15.0"
"node": "20.10.0",
"npm": "10.2.3"
},
"dependencies": {
"@empirica/core": "latest",
Expand Down
4 changes: 2 additions & 2 deletions internal/templates/source/export/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
},
"version": "1.0.0",
"volta": {
"node": "16.17.0",
"npm": "8.15.0"
"node": "20.10.0",
"npm": "10.2.3"
},
"dependencies": {
"@empirica/core": "latest",
Expand Down
4 changes: 2 additions & 2 deletions internal/templates/source/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"serve": "vite preview"
},
"volta": {
"node": "16.17.0",
"npm": "8.15.0"
"node": "20.10.0",
"npm": "10.2.3"
},
"dependencies": {
"@empirica/core": "latest",
Expand Down
4 changes: 2 additions & 2 deletions lib/@empirica/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@
}
},
"volta": {
"node": "16.17.0",
"npm": "8.15.0"
"node": "20.10.0",
"npm": "10.2.3"
},
"engines": {
"node": ">= 16.17.0"
Expand Down
4 changes: 2 additions & 2 deletions lib/admin-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
"url": "https://github.com/empiricaly/empirica/issues"
},
"volta": {
"node": "18.16.0",
"npm": "9.7.1"
"node": "20.10.0",
"npm": "10.2.3"
},
"devDependencies": {
"@julr/unocss-preset-forms": "0.0.5",
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tests/stress/experiment/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"version": "0.0.0",
"volta": {
"node": "16.17.0",
"npm": "8.15.0"
"node": "20.10.0",
"npm": "10.2.3"
}
}
4 changes: 2 additions & 2 deletions tests/stress/experiment/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"serve": "node --trace-warnings --enable-source-maps --unhandled-rejections=warn-with-error-code index.js"
},
"volta": {
"node": "16.17.0",
"npm": "8.15.0"
"node": "20.10.0",
"npm": "10.2.3"
}
}

0 comments on commit cd48506

Please sign in to comment.