Can't resolve module paths in parent directories
See original GitHub issueI use lerna for mono-repo, and here is my folder structures:
monorepo
|-- lerna.json
|-- packages/
| |-- foo/ # module `@foo`
|-- apps/
|-- react-native-app/ # react-native project
|-- package.json
In my react-native-app project, I use local module @foo by lerna, and lerna will make a symlink in the apps/react-native-app/node_modules.
After running react-native start, it failed to bundle the js code:
error: bundling failed: "Unable to resolve module `@foo` from `{path_to_file}`: Module does not exist in the module map
This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
1. Clear watchman watches: `watchman watch-del-all`.
2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
3. Reset packager cache: `rm -fr $TMPDIR/react-*` or `npm start -- --reset-cache`."
To resolve this, I need to add --root when bundling to search the paths for symlink in the node_modules by lerna:
$ react-native start --root ../../packages
Now, I can’t find a way to pass search paths to storybook node server.
$ storybook -p 7007 --root ../../packages
error: unknown option `--root'
How can I use local lerna modules with storybook?
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (8 by maintainers)
Top Results From Across the Web
Can't resolve module paths in parent directories #1804 - GitHub
In my react-native-app project, I use local module @foo by lerna, and lerna will make a symlink in the apps/react-native-app/node_modules .
Read more >Webpack fails to import module in parent directory
The webpack config considers that your working directory is defined by context. Your context is set to someDir, your component is outside ...
Read more >Documentation - Module Resolution - TypeScript
A non-relative import can be resolved relative to baseUrl , or through path mapping, which we'll cover below. They can also resolve to...
Read more >Error: Module not found on paths with a space in them - bud
Hi Bud version 6 has ModuleNotFound-Errors if a parent directory has a space in its name. It worked though in version 5.
Read more >Module Resolution - webpack
A resolver is a library which helps in locating a module by its absolute path. A module can be required as a dependency...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Yes, my plan is to take an inventory of what options you can pass
react-native startand make them work with the storybook cli.Yes but it likely will not be till next week at some time that I can do so.