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.
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.
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