Skip to content

experimentalWatchApi is broken in 4.0 #736

@MLoughry

Description

@MLoughry

Expected Behaviour

ts-loader executes without crashing while experimentalWatchApi flag is set.

Actual Behaviour

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)

Steps to Reproduce the Problem

Enable experimentalWatchApi.

The issue appears to be here, and repeated in the following few lines:

    directoryExists: path => compiler.sys.directoryExists(path.normalize(path)),

The parameter path is colliding with the import path from node.

I just tried turning this flag on as I was headed out of the office, so I'm not sure if there are other issues introduced in 4.0. I'll continue working on it tomorrow and/or next week.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions