Open maku opened 7 years ago
I also have a problem with paths and i'm using webpack 2.1.0-beta.25 with awesome-typescript-loader 2.2.4.
When using
{
"compilerOptions": {
"baseUrl": "./",
"paths": {
"*": ["src/lib/*"]
}
}
I get this error
/Users/blabla/test/node_modules/webpack/node_modules/enhanced-resolve/lib/Resolver.js:181
Resolver.prototype.join = function(path, request) {
^
RangeError: Maximum call stack size exceeded
at Resolver.join (/Users/blabla/test/node_modules/webpack/node_modules/enhanced-resolve/lib/Resolver.js:181:35)
at /Users/blabla/test/node_modules/webpack/node_modules/enhanced-resolve/lib/DescriptionFileUtils.js:11:39
at forEachBail (/Users/blabla/test/node_modules/webpack/node_modules/enhanced-resolve/lib/forEachBail.js:12:3)
at findDescriptionFile (/Users/blabla/test/node_modules/webpack/node_modules/enhanced-resolve/lib/DescriptionFileUtils.js:10:3)
at /Users/blabla/test/node_modules/webpack/node_modules/enhanced-resolve/lib/DescriptionFileUtils.js:55:13
at /Users/blabla/test/node_modules/webpack/node_modules/enhanced-resolve/lib/forEachBail.js:29:14
at /Users/blabla/test/node_modules/webpack/node_modules/enhanced-resolve/lib/DescriptionFileUtils.js:15:50
at Storage.provide (/Users/blabla/test/node_modules/webpack/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:53:20)
at CachedInputFileSystem.readJson (/Users/blabla/test/node_modules/webpack/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:164:24)
at /Users/blabla/test/node_modules/webpack/node_modules/enhanced-resolve/lib/DescriptionFileUtils.js:13:25
I've used TsConfigPathPlugin and still get a node_module cannot be found. I've run my tsconfig through with tsc and it succeeds there. Not sure what else I'm supposed to be configuring here to get it to work. Maybe webpack 2.1.0-beta.25 is not using the same alias resolution.
I'm having the same issue. my IDE successfully detects the imports done using my paths, and tsc works. However, once the it hits the loader this happens.
ERROR in ./src/index.tsx Module build failed: Error: Cannot resolve module 'whatever/SearchPanel/SearchPanel' in D:\Projects\MyProject\src\Sandbox Required in D:\Projects\MyProject\src\Sandbox\Sandbox.tsx at ResolutionError.Error (native) at new ResolutionError (D:\Projects\MyProject\node_modules\awesome-typescript-loader\dist.babel\deps.js:592:88) at D:\Projects\MyProject\node_modules\awesome-typescript-loader\dist.babel\deps.js:400:37 at run (D:\Projects\MyProject\node_modules\core-js\modules\es6.promise.js:87:22) at D:\Projects\MyProject\node_modules\core-js\modules\es6.promise.js:100:28 at flush (D:\Projects\MyProject\node_modules\core-js\modules\_microtask.js:18:9) at doNTCallback0 (node.js:419:9) at process._tickCallback (node.js:348:13) @ multi main
I have the same problem. tsc and webpack are correctly finding the imports, but as soon as I want to run the code the require (in the genereated bundle.js) fails because of 'Error: Cannot find module'
Any update on this ?
Any updates?!
I am using the version 2.2.4 of awesome-typescript-loader and I would like to use the paths definition:
e.g tsconfig.json:
shared point to a certain directory in the file system. When I try to import something from shared e.g.
import {leftPad} from 'shared/common/data/string.helper')
I get an error (Module not found: Error: Can't resolve 'shared/common/data/string.helper') with awesome-typescript-loader. But this works when I compile with tsc
Any ideas`?