Skip to content
This repository has been archived by the owner on Oct 4, 2022. It is now read-only.

Can't resolve 'styled-components' #28

Open
matthewmartin0204 opened this issue Mar 15, 2019 · 5 comments
Open

Can't resolve 'styled-components' #28

matthewmartin0204 opened this issue Mar 15, 2019 · 5 comments

Comments

@matthewmartin0204
Copy link

Having this error occur trying to use your package. Otherwise,
Screenshot from 2019-03-15 17-02-24
it looks great!

@jgcmarins
Copy link

jgcmarins commented Mar 15, 2019

we have styled-components as peer dep, it should work

"peerDependencies": {
"react": "*",
"styled-components": "*"

do you have any reproducible repo?
could you share few pieces of your package.json?

@Blackleones
Copy link

Same problem here
My package.json is:

{
  "name": "milestonekanban",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@material-ui/core": "^3.9.3",
    "@material-ui/icons": "^3.0.2",
    "react": "^16.8.6",
    "react-dom": "^16.8.6",
    "react-kanban-dnd": "^0.3.0",
    "react-router-dom": "^5.0.0",
    "react-scripts": "2.1.8"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": [
    ">0.2%",
    "not dead",
    "not ie <= 11",
    "not op_mini all"
  ]
}

@jgcmarins
Copy link

add styled-components as dependencies

@Blackleones
Copy link

Blackleones commented Apr 23, 2019

thanks you @jgcmarins . Add styled-components as dependencies does not completely solve the problem, because add styled-components install the lastest version and your library is not full compatible with it.
My current styled-components version is ^4.2.0 and when I run reactJs I get 18 errors where the first is:

Error: Invariant failed: Cannot get draggable ref from drag handle

you can reproduce these errors changing the styled-components from 3.4.9 to ^4.2.0 on live demo.

If I change styled-components version to ^4.2.0 to 3.4.9 it works.

edit: I discovered that this is a version error thanks to this post https://github.com/atlassian/react-beautiful-dnd/issues/875

@PJijin
Copy link

PJijin commented May 20, 2019

@Blackleones Does this work with styled-components 4.2.0?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants