-
Notifications
You must be signed in to change notification settings - Fork 116
Pioneer: Fix for #511 #514
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
Conversation
|
I'm convinced now there is something uniquely wrong with my local dev environment. Clearly I have some cached typescript definitions files interfering with the build |
| import { ApiProps } from "@polkadot/react-api/types"; | ||
|
|
||
| import Transport from "../../transport"; | ||
| import { Transport } from "../../transport"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I know what's the issue here. There is joy-utils/src/Transport (file) and joy-utils/src/transport (directory). Perhaps in some environments where paths are considered case insensitive import from file takes priority over the import from directory and hence the error.
|
I think you are right on the money! OSX has strange hybrid case sensitivity
and this is failing on my Mac.
Not the first time we’ve had issues with case sensitive issues with file
names :(
…On Fri, 29 May 2020 at 10:23 pm, Lezek123 ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In pioneer/packages/joy-utils/src/react/context/transport.tsx
<#514 (comment)>:
> @@ -2,7 +2,7 @@ import React, { createContext, useContext } from "react";
import { ApiContext } from ***@***.***/react-api";
import { ApiProps } from ***@***.***/react-api/types";
-import Transport from "../../transport";
+import { Transport } from "../../transport";
I think I know what's the issue here. There is joy-utils/src/Transport
(file) and joy-utils/src/transport (directory). Perhaps in some
environments where paths are considered case insensitive import from file
takes priority over the import from directory and hence the error.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#514 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMLYFBFZOCH5RNDIBHFLMTRUADTPANCNFSM4NOHN4IA>
.
|
On Mac is seems node import paths files take precedence over folder because of lack of real case sensitivity in OSX file system. eg in this case: Transport.ts and ./transport (folder) Added macos to github actions matrix to test and confirm
|
So the quick and dirty fix 2f2df78 confirms it is the issue you pointed out. I'm not sure there is an environment var to control the precedence of how node handles import paths when a file or folder match, but in this particular case its not really the issue, its actually the fact that it can't tell the different between I added a job to github workflows to build for OSX so we can spot such intricate "bugs" in future, but it would be better I think to follow a convention where we try to avoid having a file and folder with similar names that would cause this case to be problematic. |
Lezek123
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CI works well, I was able to reproduce the error in my fork.
This simple fix seems to be enough for now, I will rename the file or change the structure in this directory in some PR later (joy-utils needs some cleanup anyway, as it is currently partially the old joy-utils and patrially a work-in-progress joystream-js)

Attempt to Fix #511