I am setting up medusaJS with Strapi by default command https://docs.medusajs.com/plugins/cms/strapi
I did setup Redis, medusa cli, was using Node version 16,18. However, I got this issue
Now using node v18.13.0 (npm v8.19.3)
❯ npx create-strapi-app strapi-medusa --template shahednasser/strapi-medusa-template
? Choose your installation type Quickstart (recommended)
Creating a quickstart project.
Creating a new Strapi application at /Users/felixle/Downloads/6github_new/strapi-medusa.
Creating files.
Installing strapi-medusa-template template.
Dependencies installed successfully.
Initialized a git repository.
Your application was created at /Users/felixle/Downloads/6github_new/strapi-medusa.
Available commands in your project:
yarn develop
Start Strapi in watch mode. (Changes in Strapi project files will trigger a server restart)
yarn start
Start Strapi without watch mode.
yarn build
Build Strapi admin panel.
yarn strapi
Display all available commands.
You can start by doing:
cd /Users/felixle/Downloads/6github_new/strapi-medusa
yarn develop
Running your Strapi application.
> [email protected] develop
> strapi develop
Building your admin UI with development configuration...
Admin UI built successfully
ApplicationError: The type is required
at getFieldSize (/Users/felixle/Downloads/6github_new/strapi-medusa/node_modules/@strapi/plugin-content-manager/server/services/field-sizes.js:57:15)
at getDefaultFieldSize (/Users/felixle/Downloads/6github_new/strapi-medusa/node_modules/@strapi/plugin-content-manager/server/services/utils/configuration/layouts.js:34:10)
at appendToEditLayout (/Users/felixle/Downloads/6github_new/strapi-medusa/node_modules/@strapi/plugin-content-manager/server/services/utils/configuration/layouts.js:139:27)
at createDefaultEditLayout (/Users/felixle/Downloads/6github_new/strapi-medusa/node_modules/@strapi/plugin-content-manager/server/services/utils/configuration/layouts.js:56:10)
at createDefaultLayouts (/Users/felixle/Downloads/6github_new/strapi-medusa/node_modules/@strapi/plugin-content-manager/server/services/utils/configuration/layouts.js:40:11)
at createDefaultConfiguration (/Users/felixle/Downloads/6github_new/strapi-medusa/node_modules/@strapi/plugin-content-manager/server/services/utils/configuration/index.js:26:20)
at async generateNewConfiguration (/Users/felixle/Downloads/6github_new/strapi-medusa/node_modules/@strapi/plugin-content-manager/server/services/configuration.js:53:36)
at async Promise.all (index 13)
at async Object.syncConfigurations (/Users/felixle/Downloads/6github_new/strapi-medusa/node_modules/@strapi/plugin-content-manager/server/services/configuration.js:67:5)
at async module.exports [as bootstrap] (/Users/felixle/Downloads/6github_new/strapi-medusa/node_modules/@strapi/plugin-content-manager/server/bootstrap.js:7:3) {
details: {}
}
Could you please help me?
Thanks
The project can run
2
Answers
We cannot resolve it from our side because it is from the source code of Medusa.
I format the data by a function, then import the result into postgres DB.
So, if you need more help please inform me.
Best wish
As others have suggested, it has nothing to do with the source code of medusa per se. The problem you’re getting is a missing type field in a schema.
This part of the code, where you are getting the error from, parses the schema.json files in the content-types folders under src/api/[content-type-name]/content-types/[content-type-name]. You will notice with the specific template you’ve chosen that not all attributes in this schema.json files have a type field.
Strapi v4 introduced major changes in its schema structures. Some of the migrations to v4 can be applied automatically as it happened with shahednasser/strapi-medusa-template. But some are manually, which weren’t applied to that directory. You need to migrate the rest of the changes in the schema files to Strapi v4s new format and everything should work.
Just for reference, here is a snippet from the payment-provider content-type in v3 and then v4
v3:
v4:
Some people did this already, so I took the schema files from this repository and wrote a simple Python script to replace all the files from the mentioned repository to the template from shahednasser:
If you have any further Questions, I’m happy to answer them.
EDIT: Made the issue and what has to be done a little bit clearer.