question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Field 'browser' doesn't contain a valid alias configuration

See original GitHub issue

The 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.

log.txt

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:closed
  • Created 6 years ago
  • Reactions:41
  • Comments:40 (6 by maintainers)

github_iconTop GitHub Comments

16reactions
jeanpaulattardcommented, Nov 6, 2017

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

15reactions
TylerDev6commented, Nov 1, 2017

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Field 'browser' doesn't contain a valid alias configuration
In my webpack.config.js file I was only resolving TypeScript files i.e. ... Field 'browser' doesn't contain a valid alias configuration.
Read more >
Fix Field Browser Doesn't Contain a Valid Alias Configuration
How to Fix Field Browser Doesn't Contain a Valid Alias Configuration · Step 1: Modify Import Paths · Step 2: Ensure Correct Entry...
Read more >
FIX: Field browser doesn't contain a valid configuration
Field browser doesn't contain a valid alias configuration usually occurs if Webpack isn't configured properly or if your paths aren't correct, ...
Read more >
Fixed: Field Browser Doesn't Contain A Valid Configuration
Fixed: Field browser doesn't contain a valid configuration · What causes the error? · Solution 1: Check import paths · Solution 2: Check...
Read more >
Field 'browser' doesn't contain a valid alias configuration #2095
Steps to reproduce: Run webpack serve --mode development --config webpack.config.js in your application, with Reactotron or NetInfo installed.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found