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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot resolve dependency 'styled-reboot' #844

Closed
J-F-Liu opened this issue Feb 18, 2018 · 3 comments
Closed

Cannot resolve dependency 'styled-reboot' #844

J-F-Liu opened this issue Feb 18, 2018 · 3 comments

Comments

@J-F-Liu
Copy link

J-F-Liu commented Feb 18, 2018

yarn add styled-reboot
 yarn start
yarn run v1.3.2
$ parcel index.html
Server running at http://localhost:1234
馃毃  /Users/Junfeng/ZhimoProjects/wx-manager-react/index.jsx:5:19: Cannot resolve dependency 'styled-reboot'
  3 | import ReactDOM from "react-dom";
  4 | import { injectGlobal } from "styled-components";
> 5 | import reboot from "styled-reboot";
    |                    ^
  6 | import App from "./src/App";
  7 |
  8 | const options = {

Both 1.5.1 and 1.6.1 have this error.

@J-F-Liu
Copy link
Author

J-F-Liu commented Feb 18, 2018

Find a workaround:

cd node_modules/styled-reboot/
yarn
yarn build:dist

@lbguilherme
Copy link
Contributor

The package.json of this project is wrong:

  "main": "lib/index.js",
  "jsnext:main": "dist/styled-reboot.es.js",

Parcel will prefer jsnext:main if it is specified, but the mentioned file was not published to npm.

Maybe we can check if the jsnext:main file actually exists before resolving to it.

@J-F-Liu
Copy link
Author

J-F-Liu commented Feb 20, 2018

Agree, check if the jsnext:main file actually exists and also give a warning about this.

devongovett added a commit that referenced this issue Oct 15, 2018
The field is deprecated and replaced with package.module. Additionally it caused many issues with packages that used it incorrectly. Fixes #844, #1037, #1048, #1062.
devongovett added a commit that referenced this issue Oct 15, 2018
The field is deprecated and replaced with package.module. Additionally it caused many issues with packages that used it incorrectly. Fixes #844, #1037, #1048, #1062.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants