Skip to content

Fix name collision in experimentalWatchApi code#737

Merged
johnnyreilly merged 1 commit intoTypeStrong:masterfrom
MLoughry:fix-name-collision-in-experimental-watch-api
Mar 2, 2018
Merged

Fix name collision in experimentalWatchApi code#737
johnnyreilly merged 1 commit intoTypeStrong:masterfrom
MLoughry:fix-name-collision-in-experimental-watch-api

Conversation

@MLoughry
Copy link
Copy Markdown
Contributor

@MLoughry MLoughry commented Mar 2, 2018

Fixes #736

@johnnyreilly
Copy link
Copy Markdown
Member

Thanks!

Could you tell me some more about how this problem presented please? I haven't noticed a related issue being raised and so I'd like to understand the context for this.

@MLoughry
Copy link
Copy Markdown
Contributor Author

MLoughry commented Mar 2, 2018

As stated in #736, I got the following error when I turned on experimentalWatchApi:

Module build failed: RangeError: The normalization form should be one of NFC, NFD, NFKC, NFKD.
    at String.normalize (<anonymous>)
    at Object.directoryExists (d:\git\project\node_modules\ts-loader\dist\servicesHost.js:112:68)
    at Object.compilerHost.directoryExists (d:\git\project\node_modules\typescript\lib\typescript.js:77404:121)
    at d:\git\project\node_modules\typescript\lib\typescript.js:23409:22
    at Object.forEachAncestorDirectory (d:\git\project\node_modules\typescript\lib\typescript.js:11141:26)
    at getDefaultTypeRoots (d:\git\project\node_modules\typescript\lib\typescript.js:23407:12)
    at getEffectiveTypeRoots (d:\git\project\node_modules\typescript\lib\typescript.js:23393:20)
    at resolveTypeReferenceDirective (d:\git\project\node_modules\typescript\lib\typescript.js:23425:25)
    at resolveNamesWithLocalCache (d:\git\project\node_modules\typescript\lib\typescript.js:76752:38)
    at Object.resolveTypeReferenceDirectives (d:\git\project\node_modules\typescript\lib\typescript.js:76804:20)

Our project previously used the happyPack mode, so we don't have any previous history to go by. But the offending change, 388f2a6 8 days ago, has only been included in the 4.0.0 release from 5 days ago so far.

@johnnyreilly
Copy link
Copy Markdown
Member

Yup - totally my bad. Me and my refactoring 😄

Thanks for the fix; I'll merge and release this as 4.0.1. Hopefully sometime this weekend. Thanks again for pitching in!

@johnnyreilly johnnyreilly merged commit 095f837 into TypeStrong:master Mar 2, 2018
@johnnyreilly
Copy link
Copy Markdown
Member

Released - thanks for your help!

@MLoughry
Copy link
Copy Markdown
Contributor Author

MLoughry commented Mar 2, 2018

No problem. I tried playing around with a fixed version locally today when I had time, but ran into hangs during webpack that I couldn't reproduce in a minimal repo (with experimentalWatchApi, to be clear). Are there any diagnostics I could leverage in any future investigation?

@johnnyreilly
Copy link
Copy Markdown
Member

You could try using the trace functionality (set traceResolution: true in your tsconfig.json) which might help. Otherwise the easiest thing to do is hack console logs into it whilst you're investigating.

Basic, but it suffices!

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

Successfully merging this pull request may close these issues.

2 participants