Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model using component fails with error since update #7189

Closed
waynehaffenden opened this issue Jul 26, 2020 · 4 comments · Fixed by #7228
Closed

Model using component fails with error since update #7189

waynehaffenden opened this issue Jul 26, 2020 · 4 comments · Fixed by #7228
Labels
severity: medium If it breaks the basic use of the product but can be worked around source: core:content-manager Source is core/content-manager package status: confirmed Confirmed by a Strapi Team member or multiple community members

Comments

@waynehaffenden
Copy link

waynehaffenden commented Jul 26, 2020

Describe the bug
Any model referencing a component as an attribute fails to open admin collection type screen.

Steps to reproduce the behavior

  1. Clicking on any collection type that uses a component within Strapi admin results in follow error:
Something went wrong.
Details
TypeError: S.includes is not a function

    in w
    in w
    in withRouter(undefined)
    in u
    in q
    in q
    in z
    in t
    in t
    in Suspense
    in m
    in t
    in t
    in Suspense
    in Unknown
    in P
    in z
    in n
    in div
    in m
    in m
    in t
    in t
    in div
    in styled.div
    in div
    in div
    in styled.div
    in Vi
    in le
    in n
    in z
    in injectIntl(Connect(n))
    in t
    in d
    in t
    in div
    in styled.div
    in div
    in styled.div
    in Unknown
    in l
    in C
    in z
    in t
    in t
    in IntlProvider
    in n
    in z
    in $c
    in l

Expected behavior
The collection type admin screen opens.

Code snippets
Model collection type:

{
  "kind": "collectionType",
  "collectionName": "actors",
  "info": {
    "name": "Actor"
  },
  "options": {
    "increments": true,
    "timestamps": false
  },
  "attributes": {
    "fullName": {
      "type": "string",
      "required": true,
      "minLength": 2,
      "maxLength": 30
    },
    "picture": {
      "model": "file",
      "via": "related",
      "allowedTypes": ["images"],
      "plugin": "upload",
      "required": true
    },
    "bio": {
      "type": "text",
      "required": true,
      "minLength": 25,
      "maxLength": 1000
    },
    "social": {
      "type": "component",
      "repeatable": false,
      "component": "social.social",
      "required": false
    },
    "website": {
      "type": "string",
      "maxLength": 253
    },
    "characters": {
      "via": "actor",
      "collection": "character"
    }
  }
}

Component type:

{
  "collectionName": "components_social_socials",
  "info": {
    "name": "Social",
    "icon": "at"
  },
  "options": {
    "timestamps": false
  },
  "attributes": {
    "facebook": {
      "type": "string",
      "maxLength": 50
    },
    "instagram": {
      "type": "string",
      "maxLength": 30
    },
    "tikTok": {
      "type": "string",
      "maxLength": 24
    },
    "twitter": {
      "type": "string",
      "maxLength": 15
    },
    "youTube": {
      "type": "string",
      "maxLength": 32
    }
  }
}

System

  • Node.js version: 14.4.0
  • NPM version: 6.14.5
  • Strapi version: 3.1.1
  • Database: Mongo
  • Operating system: Alpine Linux (Docker Node Official Image)

Additional context
This was working on 3.0.1 but since the upgrade to 3.1.1 with no changes the above error occurs.

@derrickmehaffy

This comment has been minimized.

@waynehaffenden

This comment has been minimized.

@lauriejim
Copy link
Contributor

@soupette any updates on that point for the migration?
Because looks great (except an issue on the timestamp: false) if I start a fresh new app with this model and components.

soupette added a commit that referenced this issue Jul 28, 2020
Signed-off-by: soupette <cyril.lpz@gmail.com>
@soupette soupette mentioned this issue Jul 28, 2020
@soupette
Copy link
Contributor

@lauriejim I have just made a PR.

@soupette soupette added source: core:content-manager Source is core/content-manager package status: confirmed Confirmed by a Strapi Team member or multiple community members issue: bug Issue reporting a bug severity: medium If it breaks the basic use of the product but can be worked around and removed issue: help wanted issue: bug Issue reporting a bug labels Jul 28, 2020
gilfernandes pushed a commit to onepointconsulting/strapi that referenced this issue Aug 13, 2020
Signed-off-by: soupette <cyril.lpz@gmail.com>
Signed-off-by: Gil Fernandes <gil.fernandes@onepointltd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity: medium If it breaks the basic use of the product but can be worked around source: core:content-manager Source is core/content-manager package status: confirmed Confirmed by a Strapi Team member or multiple community members
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants