Barelydead / strapi-plugin-populate-deep

A Strapi plugin that makes it easier to populate deep content structures
172 stars 39 forks source link

Can't start development server after installing this plugin #2

Closed BobWez98 closed 2 years ago

BobWez98 commented 2 years ago

Output of strapi develop [2022-03-15 09:53:09.318] error: Could not load js config file /Users/bob/code/xxx-strapi/node_modules/strapi-plugin-populate-deep/strapi-server.js: Unexpected token '.'

Barelydead commented 2 years ago

Hi @BobWez98 ,

I just tried installing the plugin on a fresh strapi instance with no issues. What versions are you using for strapi and node.js?

BobWez98 commented 2 years ago

Hi @Barelydead,

i'm using node version v12.22.10 and strapi version 4.0.5. My package.json:

{
  "name": "veldmanslijptechniek-strapi",
  "private": true,
  "version": "0.1.0",
  "description": "A Strapi application",
  "scripts": {
    "develop": "strapi develop",
    "start": "strapi start",
    "build": "strapi build",
    "strapi": "strapi"
  },
  "devDependencies": {},
  "dependencies": {
    "@strapi/plugin-i18n": "4.0.5",
    "@strapi/plugin-users-permissions": "4.0.5",
    "@strapi/strapi": "4.0.5",
    "mysql": "^2.18.1",
    "sqlite3": "5.0.2"
  },
  "author": {
    "name": "A Strapi developer"
  },
  "strapi": {
    "uuid": "33ab0389-49fb-4758-95d1-ee8c6eab6c09"
  },
  "engines": {
    "node": ">=12.x.x <=16.x.x",
    "npm": ">=6.0.0"
  },
  "license": "MIT"
}
Barelydead commented 2 years ago

Thanks for the information. I think the problem is that conditional chaining eg. event.params?.populate is not available for node v12. if you upgrade to node v14 i should work.

I will update it to be compatible with v12 when i have some time

Regards

jirbjirbjirb commented 2 years ago

chiming in here to say I encountered the same error and can verify upgrading to v14 does the trick. This thread saved my day. Thank you @Barelydead

BobWez98 commented 2 years ago

Maybe we could add a requirements section in the Readme to specify you need node > 14.