Skip to content
This repository was archived by the owner on Dec 1, 2019. It is now read-only.

"TypeError: Cannot read property 'text' of undefined" with 2.0.0-rc.6 and typescript 1.9.0-dev on Windows. #170

Closed
t246246 opened this issue Jun 21, 2016 · 4 comments

Comments

@t246246
Copy link

t246246 commented Jun 21, 2016

I separate this issue from #168

When I use awesome-typescript-loader 2.0.0-rc.6 with typescript 1.9.0-dev.20160620-1.0 on Windows, both with mingw and command prompt. No errors on MacOS X and linux environment.

C:\work\plunk\node_modules\awesome-typescript-loader\src\host.ts:50
        return this.state.ts.ScriptSnapshot.fromString(file.text);
                                                           ^
TypeError: Cannot read property 'text' of undefined
    at Host.getScriptSnapshot (C:\work\plunk\node_modules\awesome-typescript-loader\src\host.ts:50:60)
    at HostCache.createEntry (C:\work\plunk\node_modules\typescript\lib\typescript.js:52034:44)
    at HostCache.getOrCreateEntryByPath (C:\work\plunk\node_modules\typescript\lib\typescript.js:52059:24)
    at getOrCreateSourceFileByPath (C:\work\plunk\node_modules\typescript\lib\typescript.js:53111:53)
    at Object.getOrCreateSourceFile [as getSourceFile] (C:\work\plunk\node_modules\typescript\lib\typescript.js:53104:24)
    at findSourceFile (C:\work\plunk\node_modules\typescript\lib\typescript.js:43908:29)
    at processSourceFile (C:\work\plunk\node_modules\typescript\lib\typescript.js:43856:27)
    at C:\work\plunk\node_modules\typescript\lib\typescript.js:43949:17
    at Object.forEach (C:\work\plunk\node_modules\typescript\lib\typescript.js:967:30)
    at processReferencedFiles (C:\work\plunk\node_modules\typescript\lib\typescript.js:43947:16)
    at findSourceFile (C:\work\plunk\node_modules\typescript\lib\typescript.js:43932:21)
    at processSourceFile (C:\work\plunk\node_modules\typescript\lib\typescript.js:43856:27)
    at processRootFile (C:\work\plunk\node_modules\typescript\lib\typescript.js:43760:13)
    at C:\work\plunk\node_modules\typescript\lib\typescript.js:43228:60
    at Object.forEach (C:\work\plunk\node_modules\typescript\lib\typescript.js:967:30)
    at Object.createProgram (C:\work\plunk\node_modules\typescript\lib\typescript.js:43228:16)
    at synchronizeHostData (C:\work\plunk\node_modules\typescript\lib\typescript.js:53082:33)
    at Object.getProgram (C:\work\plunk\node_modules\typescript\lib\typescript.js:53182:13)
    at State.updateProgram (C:\work\plunk\node_modules\awesome-typescript-loader\src\host.ts:142:38)
    at Compiler.<anonymous> (C:\work\plunk\node_modules\awesome-typescript-loader\src\instance.ts:380:23)
    at next (C:\work\plunk\node_modules\webpack\node_modules\tapable\lib\Tapable.js:83:14)
    at Compiler.<anonymous> (C:\work\plunk\node_modules\webpack\lib\CachePlugin.js:61:4)
    at Compiler.applyPluginsAsync (C:\work\plunk\node_modules\webpack\node_modules\tapable\lib\Tapable.js:85:13)
    at Compiler.<anonymous> (C:\work\plunk\node_modules\webpack\lib\Compiler.js:434:9)
    at Compilation.<anonymous> (C:\work\plunk\node_modules\webpack\lib\Compilation.js:577:13)
    at Compilation.applyPluginsAsync (C:\work\plunk\node_modules\webpack\node_modules\tapable\lib\Tapable.js:73:70)
    at Compilation.<anonymous> (C:\work\plunk\node_modules\webpack\lib\Compilation.js:572:10)
    at Compilation.applyPluginsAsync (C:\work\plunk\node_modules\webpack\node_modules\tapable\lib\Tapable.js:73:70)
    at Compilation.<anonymous> (C:\work\plunk\node_modules\webpack\lib\Compilation.js:567:9)
    at Compilation.applyPluginsAsync (C:\work\plunk\node_modules\webpack\node_modules\tapable\lib\Tapable.js:73:70)

Other setting is same as #168.

@t246246 t246246 changed the title TypeError: Cannot read property 'text' of undefined with 2.0.0-rc.6 and typescript 1.9.0-dev.20160620-1.0 on Windows, "TypeError: Cannot read property 'text' of undefined" with 2.0.0-rc.6 and typescript 1.9.0-dev on Windows. Jun 21, 2016
@t246246
Copy link
Author

t246246 commented Jun 22, 2016

On 2.0.0-rc.10 error changed

C:\work\plunk\node_modules\awesome-typescript-loader\src\host.ts:53
            throw new Error(`Requested file is unknown: ${ fileName_ }`);
                  ^
Error: Requested file is unknown: C:\work\plunk\node_modules\typescript\lib\lib.dom.generated.d.ts
    at Host.getScriptSnapshot (C:\work\plunk\node_modules\awesome-typescript-loader\src\host.ts:53:19)
    at HostCache.createEntry (C:\work\plunk\node_modules\typescript\lib\typescript.js:52034:44)
    at HostCache.getOrCreateEntryByPath (C:\work\plunk\node_modules\typescript\lib\typescript.js:52059:24)

     [rest stacktrace is same]

@s-panferov
Copy link
Owner

@t246246 thanks, I'll try to debug on windows. I think that this is some kind of problem with path normalization.

@t246246
Copy link
Author

t246246 commented Jun 22, 2016

@s-panferov

It might be related to typescript issue 9123
Pull request: 9138

@t246246
Copy link
Author

t246246 commented Jun 23, 2016

Confirmed to work with

"awesome-typescript-loader": "2.0.0-rc.11"
"typescript": "1.9.0-dev.20160623-1.0"

Thank you.

@t246246 t246246 closed this as completed Jun 23, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants