You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
--build-optimizer giving 'browser' doesn't contain a valid alias configuration error #7105
Not able to reproduce. Gives error on ng build --prod --build-optimizer
The log given by the failure.
Field 'browser' doesn't contain a valid alias configuration
/Users/gauravmukherjee/website/dashboard/v3/client/node_modules/tslib.js doesn't exist
as directory
Without --build-optimizer, ng build --aot --prod and ng build --prod --build-optimizer, run into the same issue. I have to revert back to v1.2.3
By looking at the error message below, I think it is related to how I import the module. I use the latest angular-cli v1.3.0-rc.0 templates, and angular 5.0.0-beta.0.
Here is an example of how I include the template/style
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/PATH/TO/dashboard/src'
resolve './$$_gendir/app/app.module.ngfactory' in '/PATH/TO/dashboard/src'
using description file: /PATH/TO/dashboard/package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
after using description file: /PATH/TO/dashboard/package.json (relative path: ./src)
using description file: /PATH/TO/dashboard/package.json (relative path: ./src/$$_gendir/app/app.module.ngfactory)
no extension
Field 'browser' doesn't contain a valid alias configuration
/PATH/TO/dashboard/src/$$_gendir/app/app.module.ngfactory doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
/PATH/TO/dashboard/src/$$_gendir/app/app.module.ngfactory.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
/PATH/TO/dashboard/src/$$_gendir/app/app.module.ngfactory.js doesn't exist
as directory
/PATH/TO/dashboard/src/$$_gendir/app/app.module.ngfactory doesn't exist
[/PATH/TO/dashboard/src/$$_gendir/app/app.module.ngfactory]
[/PATH/TO/dashboard/src/$$_gendir/app/app.module.ngfactory.ts]
[/PATH/TO/dashboard/src/$$_gendir/app/app.module.ngfactory.js]
[/PATH/TO/dashboard/src/$$_gendir/app/app.module.ngfactory]
@ ./src/main.ts 3:0-74
@ multi ./src/main.ts
ERROR in ./src/$$_gendir lazy
Module not found: Error: Can't resolve '/PATH/TO/dashboard/src/$$_gendir/app/capabilities/feature-name.module.ngfactory.ts' in '/PATH/TO/dashboard/src/$$_gendir'
resolve '/PATH/TO/dashboard/src/$$_gendir/app/capabilities/feature-name.module.ngfactory.ts' in '/PATH/TO/dashboard/src/$$_gendir'
using description file: /PATH/TO/dashboard/package.json (relative path: ./src/$$_gendir)
Field 'browser' doesn't contain a valid alias configuration
after using description file: /PATH/TO/dashboard/package.json (relative path: ./src/$$_gendir)
using description file: /PATH/TO/dashboard/package.json (relative path: ./src/$$_gendir/app/capabilities/feature-name.module.ngfactory.ts)
no extension
Field 'browser' doesn't contain a valid alias configuration
/PATH/TO/dashboard/src/$$_gendir/app/capabilities/feature-name.module.ngfactory.ts doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
/PATH/TO/dashboard/src/$$_gendir/app/capabilities/feature-name.module.ngfactory.ts.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
/PATH/TO/dashboard/src/$$_gendir/app/capabilities/feature-name.module.ngfactory.ts.js doesn't exist
as directory
/PATH/TO/dashboard/src/$$_gendir/app/capabilities/feature-name.module.ngfactory.ts doesn't exist
[/PATH/TO/dashboard/src/$$_gendir/app/capabilities/feature-name.module.ngfactory.ts]
[/PATH/TO/dashboard/src/$$_gendir/app/capabilities/feature-name.module.ngfactory.ts.ts]
[/PATH/TO/dashboard/src/$$_gendir/app/capabilities/feature-name.module.ngfactory.ts.js]
[/PATH/TO/dashboard/src/$$_gendir/app/capabilities/feature-name.module.ngfactory.ts]
@scttcper I tried with the fix. both with/without bo failed the same way (error identical above) tried both version of the enhanced-resolve v3.3.0 pinned, and latest v3.4.1, run into the same issue
@filipesilva It does fix the issue with rc.3. Build pipeline is fine now.
The only issue is the app does not work by missing HTTP modules. I am using the newest HttpClientModule. is it being supported with experimental --build-optimizer ?
I upgraded to angular cli 1.4.4, but I am still seeing this error
Field 'browser' doesn't contain a valid alias configuration
I tried installing "enhanced-resolve": "3.3.0", but that did not seem to help either.
ng serve throws the error and everything under /assets/ is not being resolved.
Activity
filipesilva commentedon Jul 24, 2017
Does this happen without
--build-optimizer?mattma commentedon Jul 24, 2017
@filipesilva
Without
--build-optimizer,ng build --aot --prodandng build --prod --build-optimizer, run into the same issue. I have to revert back tov1.2.3By looking at the error message below, I think it is related to how I import the module. I use the latest
angular-cli v1.3.0-rc.0templates, andangular 5.0.0-beta.0.Here is an example of how I include the template/style
scttcper commentedon Jul 24, 2017
I was getting this too its related to #7113
mattma commentedon Jul 24, 2017
@scttcper I tried with the fix. both with/without
bofailed the same way (error identical above) tried both version of theenhanced-resolvev3.3.0 pinned, and latest v3.4.1, run into the same issuescttcper commentedon Jul 24, 2017
@mattma that fix doesn't always work. They published
v1.3.0-rc.1with the pinned verisonmattma commentedon Jul 25, 2017
@scttcper I have updated to
v1.3.0-rc.1, it did not work with the same error. Now i am onv1.2.4, build works but no --build-optimizerJSMike commentedon Jul 25, 2017
fyi, for some reason I had to make sure
enhanced-resolvewas set as a dependency and not a dev-dependency for the issue to get resolved.mattma commentedon Jul 26, 2017
@JSMike Tried with your solution with
rc.1, that does not work. it did not work even withng build --prod.@filipesilva the issue was labeled with need info. What kind of info does it miss?
elvisbegovic commentedon Jul 26, 2017
same error here after passing to 1.3rc1
cc @filipesilva
thanks in advance if any news
filipesilva commentedon Jul 27, 2017
If this happens with and without
--build-optimizerthen it is a dupe of #7113, and the solution is in #7113 (comment).Be aware that yarn seem to be bugged and not resolving the dependencies properly in some versions: #7136 (comment).
mattma commentedon Jul 28, 2017
@filipesilva It does fix the issue with rc.3. Build pipeline is fine now.
The only issue is the app does not work by missing HTTP modules. I am using the newest HttpClientModule. is it being supported with experimental
--build-optimizer?filipesilva commentedon Jul 28, 2017
I'm not aware of it being unsupported... Can you open a new issue with a reproduction for me to investigate?
eddieedease commentedon Aug 24, 2017
I get this error only when i use
--build-optimer.Normal builds (and aot) works fine without it. Don't use yarn but npm. Any ideas?
filipesilva commentedon Aug 31, 2017
@eddieedease can you open a new issue with a reproduction please?
eddieedease commentedon Aug 31, 2017
Got it fixed by bumping
typescriptto2.5.1filipesilva commentedon Aug 31, 2017
Your issue was most like #7110 then.
playground commentedon Sep 7, 2017
@filipesilva is this related to #7341?
I was getting
after upgrading to typescript v2.5.2, that error went away but getting "cannot find module" for AoT.
I'm on cli v1.4.0
joshikeerti commentedon Oct 4, 2017
I upgraded to angular cli 1.4.4, but I am still seeing this error
Field 'browser' doesn't contain a valid alias configuration
I tried installing "enhanced-resolve": "3.3.0", but that did not seem to help either.
ng serve throws the error and everything under /assets/ is not being resolved.
raysuelzer commentedon Nov 6, 2017
A similar issue occurs for me on Travis using Node 7 and NPM 5. Downgrading to NPM 4 resolves the issue. Also Node 6 and NPM 5 work.
FrancescoBorzi commentedon Nov 20, 2017
I'm also experiencing this issue using
ng build --prod. Cli version1.5.2husainsr commentedon Dec 2, 2017
I am also experience same issue that "ngfactory not found" and "Field 'browser' doesn't contain a valid alias configuration"
stefdelec commentedon Dec 4, 2017
SAme here. Any update ?
angular-automatic-lock-bot commentedon Sep 7, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.