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

gatsby v2.13.65 -> v2.13.66 introduces a lot of warnings in Windows due to path changes #16721

Closed
karland opened this issue Aug 18, 2019 · 10 comments · Fixed by #17492
Closed
Assignees
Labels
type: bug An issue or pull request relating to a bug in Gatsby

Comments

@karland
Copy link

karland commented Aug 18, 2019

Description

I am on Windows 10. After updating from Gatsby v2.13.65 -> 2.13.66 I get a lot of warnings resulting from the path letter being different, such as this

 warning  in D:/my/Websites/node_modules/object-assign/index.js
⠀
There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Use equal casing. Compare these module identifiers:
* D:\my\Websites\node_modules\object-assign\index.js
    Used by 160 module(s), i. e.
    D:\my\Websites\node_modules\react\cjs\react.development.js
* d:\my\Websites\node_modules\object-assign\index.js
    Used by 4 module(s), i. e.
    d:\my\Websites\node_modules\react\cjs\react.development.js

I believe the error results from cac4246

Up until Gatsby v2.13.65 all path letters were in lower cases, which was good.

I also believe the Windows path letters in packages/gatsby/src/utils/tests/path.js should be lower case.

@karland
Copy link
Author

karland commented Aug 23, 2019

@waltercruz Did you see this issue? Thanks.

@waltercruz
Copy link
Contributor

waltercruz commented Aug 23, 2019

I will check it out!

@waltercruz waltercruz self-assigned this Aug 23, 2019
@caseyWebb
Copy link

See this comment.

tl;dr: use powershell

@waltercruz
Copy link
Contributor

Hi @karland , have you seen @caseyWebb comment?

I still can implement his last suggestion, "Gatsby could always enforce/assume uppercase drive letters when checking paths", but I will need some more days (don't have access any windows machine to test).

@karland
Copy link
Author

karland commented Sep 6, 2019

Hi @waltercruz. Yes, I have seen the excellent and very nice explanation of @caseyWebb. Based on this explanation, I now understand the source of the problem and can now work around it. I still think, however, it would be good in Gatsby internally to always convert Windows drive letters to uppercase to solve this problem for good, but I have no clue how difficult this is. Thanks a lot for your kind offer/help.

@sidharthachatterjee sidharthachatterjee added the type: bug An issue or pull request relating to a bug in Gatsby label Sep 7, 2019
@jannikbuschke
Copy link
Contributor

jannikbuschke commented Sep 7, 2019

I'm seeing this issue in Azure Devops:
image
with NPM tasks

Happens with gatsby 2.15.9
Does not happen with gatsby 2.13.65

@waltercruz
Copy link
Contributor

waltercruz commented Sep 7, 2019

Hey @jannikbuschke , please see this comment. BTW, glad that you remembered of Azure, I will try to use a windows machine there to test. I will fix it in the next days.

waltercruz added a commit to waltercruz/gatsby that referenced this issue Sep 8, 2019
Fix the weird way that windows handles drive letter upper/lower case.
waltercruz added a commit to waltercruz/gatsby that referenced this issue Sep 8, 2019
Fix the weird way that windows handles drive letter upper/lower case.
@sidharthachatterjee
Copy link
Contributor

Fixed and published in gatsby@2.15.10 thanks to @waltercruz 🥇

@stephen-zhao
Copy link

Hello.. so it seems I am still getting a very similar issue. I am on Gatsby version 2.15.29 and Gatsby-CLI version 2.7.54, running on WSL Ubuntu.

warn The plugin "dev-404-page" created a page with a component path that doesn't match the casing of the actual file.
This may work locally, but will break on systems which are case-sensitive, e.g. most CI/CD pipelines.
page.component:     "/mnt/d/projects/Dev_Projects/stephen-zhao.github.io/.cache/dev-404-page.js"
path in filesystem: "/mnt/d/Projects/Dev_Projects/stephen-zhao.github.io/.cache/dev-404-page.js"
                            ^

The same applies to plugin gatsby-plugin-page-creator as well as several components inside node_modules. Not sure what is going on... Why would gatsby want to change the first uppercase character it encounters to a lowercase (the subsequent uppercase characters are unaffected)?

@waltercruz
Copy link
Contributor

Why would gatsby want to change the first uppercase character it encounters to a lowercase (the subsequent uppercase characters are unaffected)?

Long history, but it's about windows filesystem and the weird way that windows handles it. See this comment.

But long story short, it should not try to uppercase the first letter if it's running on WSL. My code by now just checks if is running on windows, I should probably check if running on WSL and don't fo the uppercase of the first letter.

I will create a ticket and assign it to myself, but I will only have time to do it in some days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
6 participants