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

Compile errors when using from Docker. #246

Open
richardspence opened this issue Dec 4, 2018 · 1 comment
Open

Compile errors when using from Docker. #246

richardspence opened this issue Dec 4, 2018 · 1 comment

Comments

@richardspence
Copy link

When building browserify from docker, tsify will complain about "cannot find module abc". I noticed casing anomalies during output, and after some investigation/debugging determined it's related to normalizing filenames in host.js that is somehow not working as expected when executing from a docker environment.

repro: (on mac, simplified steps)

  1. create a new project

  2. Add a repro.d.ts file that imports a module
    a. npm i -S @types/events' b. in repro.d.ts file i. add imports {EventEmitter} from 'events'`
    ii. Export something
    bundle with browserify, and tsify plugin, default options (I used the CLI)
    expected: output.
    actual: output.

  3. In a docker image, do the same process. Mount local file system into docker

expected: output.
Actual: TS Errors complaining about 'cannot find module'

Workaround: set "forceConsistentCasingInFileNames": true, in tsconfig. This is read by Host.js to normalize filenames which is related to this bug.

@cartant
Copy link
Contributor

cartant commented Dec 4, 2018

The plugin attempts to detect whether or not the host OS has a case-sensitive file system. See https://github.com/TypeStrong/tsify/blob/master/lib/Host.js#L17-L24

If for some reason, this is not working within Docker, I think you will have to stick with the work around, as I don't have time to look into this, ATM.

Also, if it works fine without that dependency, I'd suggest that there is something amiss within that specific dependency (or its types) that can be addressed upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants