Oak-Digital / types-4-strapi-2

Automate the creation of typescript interfaces for your strapi 4 projects
MIT License
24 stars 4 forks source link

Doesnt work with Strapi 4.4.x #16

Closed hyenabyte closed 1 year ago

hyenabyte commented 1 year ago

Tested with Strapi 4.4.3

Command fails with:

> backend@0.1.0 types
> t4s -o ../project-com/lib/interfaces/generated/ --prettier ../project-com/.prettierrc.yml --delete-old

/home/hyena/Documents/Workspace/project-strapi/node_modules/@oak-digital/types-4-strapi-2/lib/interface/InterfaceManager.js:87
        this.Options.enabledPlugins.forEach(function (enabledPlugin) {
                                    ^

TypeError: Cannot read properties of undefined (reading 'forEach')
    at InterfaceManager.validateOptions (/home/hyena/Documents/Workspace/project-strapi/node_modules/@oak-digital/types-4-strapi-2/lib/interface/InterfaceManager.js:87:37)
    at new InterfaceManager (/home/hyena/Documents/Workspace/project-strapi/node_modules/@oak-digital/types-4-strapi-2/lib/interface/InterfaceManager.js:73:14)
    at Object.<anonymous> (/home/hyena/Documents/Workspace/project-strapi/node_modules/@oak-digital/types-4-strapi-2/lib/index.js:23:15)
    at Module._compile (node:internal/modules/cjs/loader:1126:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
    at Module.load (node:internal/modules/cjs/loader:1004:32)
    at Function.Module._load (node:internal/modules/cjs/loader:839:12)
    at Module.require (node:internal/modules/cjs/loader:1028:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/hyena/Documents/Workspace/project-strapi/node_modules/@oak-digital/types-4-strapi-2/bin/index.js:2:1)
hyenabyte commented 1 year ago

I also installed the color-picker plugin, that might cause problems with the types?

Edit: the color picker seems to just save the data as a string

Alexnortung commented 1 year ago

Seems to be a problem if no plugins were set.

This should work in v0.3.6