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

[3.3.3] eslint: Unable to resolve path to module @storybook/react #2602

Closed
DimaRGB opened this issue Dec 28, 2017 · 12 comments
Closed

[3.3.3] eslint: Unable to resolve path to module @storybook/react #2602

DimaRGB opened this issue Dec 28, 2017 · 12 comments
Assignees

Comments

@DimaRGB
Copy link

DimaRGB commented Dec 28, 2017

Issue details

After update to 3.3.3 see eslint error: Unable to resolve path to module @storybook/react. (import/no-unresolved)

Please specify which version of Storybook and optionally any affected addons that you're running

  • @storybook/react 3.3.3

Screenshots / Screencast / Code Snippets (Optional)

import * as storybook from '@storybook/react';

eslintrc.js:

  ...
  parserOptions: {
    ecmaVersion: 8,
    sourceType: 'module',
    ecmaFeatures: {
      impliedStrict: true,
      jsx: true,
    },
  },
  ...
@DimaRGB DimaRGB changed the title [3.3.3] Unable to resolve path to module @storybook/react [3.3.3] Eslint: Unable to resolve path to module @storybook/react Dec 28, 2017
@DimaRGB DimaRGB changed the title [3.3.3] Eslint: Unable to resolve path to module @storybook/react [3.3.3] eslint: Unable to resolve path to module @storybook/react Dec 28, 2017
@Hypnosphi
Copy link
Member

Probably related to adding jsnext:main in #2589

@Hypnosphi Hypnosphi added the bug label Dec 28, 2017
@Hypnosphi Hypnosphi self-assigned this Dec 28, 2017
@DimaRGB
Copy link
Author

DimaRGB commented Dec 28, 2017

seems like eslint try to use jsnext:main but src folder not published.

@alansouzati
Copy link

hey, great that we have a merged PR for this! :) Any news when we will have it released? also, I believe this issue can be closed?

@Hypnosphi
Copy link
Member

Hypnosphi commented Jan 4, 2018

@shilman how do you feel about a patch release (or maybe even a minor, once we decided to have more of them)?

@Hypnosphi
Copy link
Member

Hypnosphi commented Jan 7, 2018

Fix released as 3.3.4. Sorry for the delay

@hswolff
Copy link
Contributor

hswolff commented Jan 7, 2018

Sadly I'm still seeing this issue.

The PR only removed src from the root .npmignore and not from the individual package itself: https://github.com/storybooks/storybook/blob/master/app/react/.npmignore#L2

I believe we need to remove that from the individual package to have the src directory published as well.

@Hypnosphi Hypnosphi reopened this Jan 8, 2018
@Hypnosphi
Copy link
Member

Hypnosphi commented Jan 8, 2018

Oh I see. Would you like to make a PR?

@hswolff
Copy link
Contributor

hswolff commented Jan 8, 2018

Incoming!

@hswolff
Copy link
Contributor

hswolff commented Jan 8, 2018

PR: #2677

@csi-lk
Copy link

csi-lk commented Jan 8, 2018

Hmm if I manually remove src line from the .npmignore in the @storybook/react folder I still get this eslint error, it could be i'm misunderstanding the solution?

@hswolff
Copy link
Contributor

hswolff commented Jan 8, 2018

You mean in your node_modules folder in your application? I'm guessing that it's because the jsnext:main value points to a file that doesn't exist. Perhaps try copying over the src/ folder from this repo into your node_modules folder, which should fix the issue. May be good to do that to verify. That's what my PR will change when a new npm package is published.

@csi-lk
Copy link

csi-lk commented Jan 8, 2018

I ended up giving up and reverting, will just wait for this change to come through, cheers

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

No branches or pull requests

5 participants