elderfo / react-native-storybook-loader

An automatic story loader for react-native-storybooks
https://github.com/elderfo/react-native-storybook-loader
MIT License
299 stars 27 forks source link

Unable to resolve module '...' from 'storyLoader.js' #23

Open xareelee opened 7 years ago

xareelee commented 7 years ago

I think it is not react-native-storybook-loader's problem, but I think you may provide some information about this issue.

I put the .stories.js file under a __tests__ folder and refreshed the storyLoader.js generated by react-native-storybook-loader, then it shows an error:

I put the same file in a non-__tests__ folder and refreshed the storyLoader.js again, then it goes well.

// storyLoader.js
require('./../src/ofo_api/__tests__/API.stories.js'); // error
require('./../src/ofo_api//API.stories.js');  // good

I did not find any clue about this issue. Do you know why?

elderfo commented 7 years ago

Sorry I haven't been able to look into this yet. I should be able to check out this and the other issue you logged this weekend.

elderfo commented 7 years ago

It appears __tests__ folders are excluded by the React Native packager. It looks to be hard coded.

I also verified by creating a new React Native project and creating a component in a __tests__ folder and got the same error.

I suggest logging an issue/feature request on the React Native project (feel free to reference this issue so we can track progress). I do think this is a legitimate use case.

elderfo commented 7 years ago

@xareelee, did you open an issue with the React Native team? If so, can you link it here?

xareelee commented 7 years ago

Nope, I did not. I'm not sure how to describe this issue in the React Native repo.

How about that you report this issue there?

elderfo commented 7 years ago

Ok, I will log one and link it.

BatDroid commented 4 years ago

@elderfo still have the issue. how did it go with the report?