Skip to content

Commit e717a43

Browse files
committed
Fix runtime error caused by knox dependency, mime
A similar commit was made in onenorth/keystone to fix this issue. Knox has its own dependency, mime. Knox is no longer maintained and there is an issue with the way it defined its mime dependency in that it did not lock down mime’s version number. Just 2 months ago, mime updated to version 4.0, which no longer supports below Node 14. Our Keystone sites still run on Node 10 so this results in a runtime error (`SyntaxError: Unexpected identifier` on module export syntax) that can’t be worked around. Keystone Classic fixed this by updating to a fork of knox called knox-s3, which specifies a version of mime but is otherwise the same. This commit applies the same fix. Links: Automattic/knox#326 https://github.com/broofa/mime/blob/main/README.md?plain=1#L21 https://github.com/keystonejs/keystone-classic/blob/master/package.json#L63
1 parent b931752 commit e717a43

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

middleware/healthcheck.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var async = require('async'),
55
cloudinary = require('cloudinary'),
66
fs = require('fs'),
77
handlebars = require('handlebars'),
8-
knox = require('knox'),
8+
knox = require('knox-s3'),
99
NodeCache = require('node-cache'),
1010
request = require('request');
1111

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"azure-storage": "^0.7.0",
2424
"cloudinary": "^1.2.6",
2525
"handlebars": "^4.0.5",
26-
"knox": "^0.9.2",
26+
"knox-s3": "^0.9.5",
2727
"node-cache": "^3.0.0",
2828
"oauth": "^0.9.14",
2929
"range_check": "^1.4.0",

0 commit comments

Comments
 (0)