colinmeinke / ghost-storage-adapter-s3

An AWS S3 storage adapter for Ghost
Other
183 stars 87 forks source link

TypeError: Class constructor StorageBase cannot be invoked without 'new' #18

Closed jpalladino84 closed 7 years ago

jpalladino84 commented 7 years ago

Using:

ghost v1.2.0 ghost-storage-adapter-s3 v2.0.0

Partial trace:

TypeError: Class constructor StorageBase cannot be invoked without 'new'\n
at new Store (/var/www/ghost/content/adapters/storage/s3/index.js:49:104)\n
at Object.getStorage (/var/www/ghost/versions/1.2.0/core/server/adapters/storage/index.js:74:21)\n
at setupBlogApp (/var/www/ghost/versions/1.2.0/core/server/blog/app.js:61:66)\n
at setupParentApp (/var/www/ghost/versions/1.2.0/core/server/app.js:65:36)\n
at /var/www/ghost/versions/1.2.0/core/server/index.js:72:37\n

Google:

Looks to be an issue with Babel transpilation. See https://github.com/gajus/react-css-modules/issues/196

colinmeinke commented 7 years ago

Okay so it seems Babel cannot compile classes to ES5 that extend real ES2015 classes, which ghost storage base is.

I will update to compile with babel preset env instead instead of the full ES2015 plugin, and target only the node versions required.

Can anybody confirm that the storage adapter always runs on node, not in the browser, and which versions of node are officially supported by ghost? cc @kirrg001?

colinmeinke commented 7 years ago

@jpalladino84 could you try out 2.0.1 and let me know if that fixes the issue. Would also appreciate a PR of any updates to the documentation to get it up and running, if you find anything is missing.

jpalladino84 commented 7 years ago

Tested 2.0.1 and confirmed it works! Thanks @colinmeinke!