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

Error with Version 3.0.8 #382

Open
kcsahoo opened this issue Feb 26, 2017 · 25 comments
Open

Error with Version 3.0.8 #382

kcsahoo opened this issue Feb 26, 2017 · 25 comments

Comments

@kcsahoo
Copy link

kcsahoo commented Feb 26, 2017

I am using V 3.0.8 with Typescript 2.1.1
I am getting error:
Module Build Failed : Error: Final loader didn't return a Buffer or String

The same error throws with any V 3 and Typescript 2.1,x

It works with V 2.2.4 and Typescript 2.0.10

ts-loader does not have problem with Typescript 2.2.1

Can this be fixed please.
Note - I have installed all loaders advised in different forums.

@jonrimmer
Copy link

Is every loader name in your webpack.config.js suffixed with "-loader"? This is a requirement in Webpack 2, and can cause the error you're getting. E.g.

  loaders: ['ng-annotate', 'awesome-typescript']

Is no longer valid. It must be:

  loaders: ['ng-annotate-loader', 'awesome-typescript-loader']

@RafaelSalguero
Copy link

I have the same problem, the loaders names are correct on my project

@giniedp
Copy link

giniedp commented Mar 3, 2017

this is what i am getting during compilation since version 3.0.8

[at-loader]: Child process failed to process the request:  TypeError: Cannot read property 'path' of undefined
    at /Users/alex/repositories/gebeco/gbc3/node_modules/typescript/lib/typescript.js:43764:45
    at Map.forEach (native)
    at createResolver (/Users/alex/repositories/gebeco/gbc3/node_modules/typescript/lib/typescript.js:43759:49)
    at Object.createTypeChecker (/Users/alex/repositories/gebeco/gbc3/node_modules/typescript/lib/typescript.js:24712:28)
    at Object.getTypeChecker (/Users/alex/repositories/gebeco/gbc3/node_modules/typescript/lib/typescript.js:64254:79)
    at synchronizeHostData (/Users/alex/repositories/gebeco/gbc3/node_modules/typescript/lib/typescript.js:81190:21)
    at Object.getProgram (/Users/alex/repositories/gebeco/gbc3/node_modules/typescript/lib/typescript.js:81272:13)
    at processInit (/Users/alex/repositories/gebeco/gbc3/node_modules/awesome-typescript-loader/src/checker/runtime.ts:264:33)
    at /Users/alex/repositories/gebeco/gbc3/node_modules/awesome-typescript-loader/src/checker/runtime.ts:460:21
    at Object.send (/Users/alex/repositories/gebeco/gbc3/node_modules/awesome-typescript-loader/src/checker/runtime.ts:27:21)
    at Checker.req (/Users/alex/repositories/gebeco/gbc3/node_modules/awesome-typescript-loader/src/checker/checker.ts:101:21)
    at new Checker (/Users/alex/repositories/gebeco/gbc3/node_modules/awesome-typescript-loader/src/checker/checker.ts:80:14)
    at Object.ensureInstance (/Users/alex/repositories/gebeco/gbc3/node_modules/awesome-typescript-loader/src/instance.ts:129:21)
    at compiler (/Users/alex/repositories/gebeco/gbc3/node_modules/awesome-typescript-loader/src/index.ts:45:22)
    at Object.loader (/Users/alex/repositories/gebeco/gbc3/node_modules/awesome-typescript-loader/src/index.ts:14:18)
    at LOADER_EXECUTION (/Users/alex/repositories/gebeco/gbc3/node_modules/loader-runner/lib/LoaderRunner.js:119:14)

@vincentw56
Copy link

Same problem here. I double-checked my loader names, Now I cannot get it to build.

@RafaelSalguero
Copy link

I fixed my problem by having the same case on the requires and on the file and folder names. This is problematic since my enviroment is case-insensitive

@vincentw56
Copy link

I am using Windows so case shouldn't matter. It has never been an issue before. This has been working fine for me until just today. I switched to ts-loader and everything works fine. It is slower, but at least I can do my work.

@szahn
Copy link

szahn commented Mar 7, 2017

Same problem. in Windows. Using Webpack 2.2.1, Typescript 2.1.5 awesome-typescript-loader 3.0.8.

I realized this error was the result of a require statement referencing a file with incorrect casting in a case-insensitive OS (like Windows). It would be great if the error message was more precise. Can it check for mismatches in file casing?

@vincentw56
Copy link

Looks like this is fixed in version 3.1.2.

@kcsahoo
Copy link
Author

kcsahoo commented Mar 10, 2017

No
I am using Awesome 3.1.2 and Typescript 2.2.1
I am getting the following error:
Module build failed:Error:Final loader didn't return a Buffer or String
I am using Windows.

Everything works with combination:
Awesome 2.2.4 and Typescript 2.1.1/2.0.10

With Typescript 2.2.1 and ts-loader, no problem.

@kcsahoo
Copy link
Author

kcsahoo commented Mar 10, 2017

I am using webpack 2.2.1 if it helps to identify the issue

@kcsahoo
Copy link
Author

kcsahoo commented Mar 10, 2017

Issue resolved with Awesome 3.1.2 and Typescript 2.2.1.
I had duplicate tsconfig.json with non-matching entries.
Removed duplicate and the error disappeared.

@kcsahoo
Copy link
Author

kcsahoo commented Mar 13, 2017

No I am wrong.
It still does not work and has the same error.
Only works with ATL V2.2.4 and Typescript 2.1.1/2.0.10

@vincentw56
Copy link

I am running Webpack 2.2.1, Typescript 2.2.1, and Awesome Typescript Loader 3.1.2 with no issues. Try deleting your .awcache folder. I've found sometimes that fixes some issues with Awesome Typescript Loader.

@kcsahoo
Copy link
Author

kcsahoo commented Mar 14, 2017

Where is .awcache folder?
I cannot find in node_modules folder.

@vincentw56
Copy link

It is not in the node_modules folder. It should be in the root or same folder level as the node_modules level. That is how it is on all my projects on Windows.

image

@giniedp
Copy link

giniedp commented Mar 14, 2017

i dont use the cache, and still experience the issue. Thus i'm stuck at version 3.0.7 as my last stable version

typescript: 2.2.1
webpack: 2.2.1

@kcsahoo
Copy link
Author

kcsahoo commented Mar 15, 2017

I also do not use cache nor have .awcache directory.
The strange thing is ts-loader works fine with Typescript 2.2.1.
In ATL, everything works with V 2.2.4 and Typescript 2.1.1
Once Typescript version is chosen as 2.1.4 or above, errors pop up from ATL.
There were breaking changes in TS 2.1.4.
ATL has not been checked for TS versions 2.1.4 and above.
Small examples work but a reasonably big application breaks.

@kcsahoo
Copy link
Author

kcsahoo commented Mar 15, 2017

Does not work with ATL 3.0.7 for me.
Only 2.2.4/2.1.1 or 2.2.4/2.0.10 combinations work.

@giniedp
Copy link

giniedp commented Mar 16, 2017

i am using the option useTranspileModule. If i set it to false, i get the error that is discussed in #372

I also found out, that if i remove typeRoots from my tsconfig.json, i dont get any of these errors. Obviously i get other build errors without typings.

@giniedp
Copy link

giniedp commented Mar 16, 2017

now #372 references the issue #320 that is about empty d.ts files. And indeed i do have an empty index.d.ts in my typings folder. I remember that i created it some time ago, when typescript or ATL did not compile without it for some reason (dont remember)

If i remove the empty file, i can successfully build with latest ATL version

@vincentw56
Copy link

That could be why I am not having issues now. These are my options in tsconfig:

  "awesomeTypescriptLoaderOptions": {
    "doTypeCheck": true,
    "forkChecker": true,
    "useBabel": true,
    "useCache": true
  }

@BrainCrumbz
Copy link

BrainCrumbz commented Mar 20, 2017

Just had this issue, more or less out of the blue (it wasn't there last time project was built on this dev machine), with webpack 2.2.1, ATL 3.0.8, TS 2.2.1.

In order to fix it, in the following order, we:

(so, not sure yet if adding watchpack was really needed).

EDIT uninstalling and installing again webpack "naturally" lead to picking the latest watchpack 1.x.x available, 1.3.1

OT: @vincentw56 could not get a complete list of properties available for awesomeTypescriptLoaderOptions. I kinda remember that forkChecker has been recently made obsolete, with webpack 2.2.x I guess. Do you know about any reference on available options? Thanks

@kcsahoo
Copy link
Author

kcsahoo commented Mar 21, 2017

In tsconfig.json, I configured the following:
"awesomeTypescriptLoaderOptions": {
"useWebpackText": true,
"useTranspileModule": true,
"doTypeCheck": true,
"forkChecker": true
},

Then I am able use ATL 3.2.1 and Typescript 2.2.1
No errors.

Thanks to everyone who interacted and helped.

@kcsahoo
Copy link
Author

kcsahoo commented Mar 30, 2017

Only this also works:

In tsconfig.json, I configured the following:
"awesomeTypescriptLoaderOptions": {
"useWebpackText": true,
"useTranspileModule": true
},

Then I am able use ATL 3.2.1 and Typescript 2.2.2
No errors.

@trodrigues
Copy link

trodrigues commented Jul 5, 2017

Same here, works using only useTranspileModule set to true.

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

8 participants