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

Doesn't work on Windows if launched from a shell with lowercase drive letter #843

Closed
shilman opened this issue Apr 15, 2017 · 4 comments
Closed

Comments

@shilman
Copy link
Member

shilman commented Apr 15, 2017

Issue by thedgbrt
Sunday Nov 13, 2016 at 19:15 GMT
Originally opened as storybook-eol/react-native-storybook#113


Hey guys,
congrats for the work on storybook, it's blowing my mind and transforming the way I make apps for the better 😄 !

If I run npm run storybook from a shell starting with a lowercase drive letter : c:\Users\dagobert\dev\awesomeApp>, it warns me of conflicts between modules and then crashes with an error 500.

WARNING in C:/Users/dagobert/dev/awesomeApp/~/babel-runtime/~/core-js/library/modules/_to-index.js
There is another module with an equal name when case is ignored.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Rename module if multiple modules are expected or use equal casing if one module is expected.
[...hundreds of these]

Error: File C:\Users\dagobert\dev\awesomeApp\node_modules\react-native\packager\react-packager\src\Resolver\polyfills\prelude_dev.js not found in any of the roots
    at Fastfs._getAndAssertRoot (C:/Users/dagobert/dev/awesomeApp/node_modules/react-native/packager/react-packager/src/node-haste/fastfs.js:163:21)
    at Fastfs._getFile (C:/Users/dagobert/dev/awesomeApp/node_modules/react-native/packager/react-packager/src/node-haste/fastfs.js:173:25)
    at Fastfs.readFile (C:/Users/dagobert/dev/awesomeApp/node_modules/react-native/packager/react-packager/src/node-haste/fastfs.js:93:23)
    at Polyfill._read (C:/Users/dagobert/dev/awesomeApp/node_modules/react-native/packager/react-packager/src/node-haste/Module.js:120:40)
    at _cache.get (C:/Users/dagobert/dev/awesomeApp/node_modules/react-native/packager/react-packager/src/node-haste/Module.js:139:16)
    at Cache.get (C:/Users/dagobert/dev/awesomeApp/node_modules/react-native/packager/react-packager/src/node-haste/Cache/index.js:82:35)
    at Polyfill.read (C:/Users/dagobert/dev/awesomeApp/node_modules/react-native/packager/react-packager/src/node-haste/Module.js:134:24)
    at Bundler._toModuleTransport (C:/Users/dagobert/dev/awesomeApp/node_modules/react-native/packager/react-packager/src/Bundler/index.js:577:14)
    at module (C:/Users/dagobert/dev/awesomeApp/node_modules/react-native/packager/react-packager/src/Bundler/index.js:412:14)
    at Array.map (native)

It took me two hours to realize that when I'm launching the command from this location C:\Users\dagobert\dev\awesomeApp> instead, it works as intended.

The conflict comes from the uppercase / lowercase drive letter on windows, as both work for navigating in the terminal.

I did some digging and found these issues in other npm modules
webpack/webpack#2694

And this one that might be the solution (26 Sept by Allov)
webpack/webpack#2815 (comment)

It seems like it can be fixed by forcing the script to cd to the same directory(but starting with an uppercase letter) before running any other command.

If you let me know where the script happens I can try to fix it.

@TheTFo
Copy link

TheTFo commented May 6, 2017

Any traction on this? I'm seeing it, kinda gross.

@usulpro
Copy link
Member

usulpro commented May 7, 2017

@TheTFo, @thedgbrt It's a really ugly bug. But I think it's more general issue of Node then Storybook.
We need to avoid lowercase drive letters via steps like this.
Be happy to know if there is more generic solution/script for that!

@usulpro
Copy link
Member

usulpro commented May 7, 2017

You can use this https://www.npmjs.com/package/driveup as a hotfix for this issue. It changes the drive letter the UpperCase:

e:\your_project_path>driveup
 
E:\your_project_path>

or to launch your shell:

e:\>startcmd cmder e:\your_project_path

@ndelangen
Copy link
Member

Doesn't seem to be an issue with Storybook, but good to know the work-arounds!

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

4 participants