Field 'browser' doesn't contain a valid alias configuration
See original GitHub issueThe build fails when trying to perform a build involving a requirejs dependency which also requires other files.
In this case the following error appears: Field ‘browser’ doesn’t contain a valid alias configuration
The error does not occur if the required file dependency has no dependencies, and it appears to have been introduced after 1.2.6. This affects both jit & aot builds.
Bug Report or Feature Request (mark with an x
)
- [ X] bug report -> please search issues before submitting
- [ ] feature request
Versions.
@angular/cli: 1.4.7 node: 8.5.0 os: darwin x64 @angular/animations: 4.4.5 @angular/common: 4.4.5 @angular/compiler: 4.4.5 @angular/core: 4.4.5 @angular/forms: 4.4.5 @angular/http: 4.4.5 @angular/platform-browser: 4.4.5 @angular/platform-browser-dynamic: 4.4.5 @angular/router: 4.4.5 @angular/cli: 1.4.7 @angular/compiler-cli: 4.4.5 @angular/language-service: 4.4.5 typescript: 2.3.4
Repro steps.
Example Repository Using 1.2.6 of the cli will build correctly.
- ng new project
- add requirejs
- add path inside tsconfig
- require a file using the path
At this stage the project builds and runs as expected.
However if the required file has other dependencies they will not be resolved and the build breaks.
The log given by the failure.
Desired functionality.
Nested modules should resolve correctly.
Mention any other details that might be useful.
The regression was introduced after 1.2.6. The example repo was built with cli 1.4.7.
Related Issue Related Issue 7341
Issue Analytics
- State:
- Created 6 years ago
- Reactions:41
- Comments:40 (6 by maintainers)
I am getting the issue @TylerDev6 mentioned… It seems that instead of looking into the /node_modules folder, it’s searching within the src folder…
This started happening after upgrading to angular v5, angular cli 1.5 and typescript 2.4.2
I am getting this error in the latest CLI, with rxjs 5.4.2…
Field ‘browser’ doesn’t contain a valid alias configuration C:\Users\tpadle01\IdeaProjects\onland-ui\src\rxjs\operators.js doesn’t exist as directory C:\Users\tpadle01\IdeaProjects\onland-ui\src\rxjs\operators doesn’t exist looking for modules in C:\Users\tpadle01\IdeaProjects\onland-ui\src using description file: C:\Users\tpadle01\IdeaProjects\onland-ui\package.json (relative path: ./src) Field ‘browser’ doesn’t contain a valid alias configuration after using description file: C:\Users\tpadle01\IdeaProjects\onland-ui\package.json (relative path: ./src) using description file: C:\Users\tpadle01\IdeaProjects\onland-ui\package.json (relative path: ./src/rxjs/operators) no extension