Skip to content

Angular 19 - Doesn't compile. Could not resolve "@angular/flex-layout/flex" #337

Open
@vbukhari-twn

Description

@vbukhari-twn

Bug Report or Feature Request (mark with an x)

- [ x ] bug report -> please search issues before submitting
- [    ] feature request

OS and Version?

Windows 11

Versions

Angular CLI: 19.0.6
Node: 18.20.5
Package Manager: npm 10.8.2
OS: win32 x64

Package Version

@angular-devkit/architect 0.1900.6
@angular-devkit/build-angular 19.0.6
@angular-devkit/core 19.0.6
@angular-devkit/schematics 19.0.6
@angular/cdk 19.0.4
@angular/cli 19.0.6
@angular/google-maps 19.0.4
@angular/material 19.0.4
@schematics/angular 19.0.6
rxjs 7.8.1
typescript 5.6.3
zone.js 0.15.0

@angular-material-extensions/google-maps-autocomplete 16.4.0

Repro steps

Installed all dependencies per instructions except '@angular/flex-layout'
Add code to app.module.ts
Doesn't Compile (see log below)

The log given by the failure

[ERROR] Could not resolve "@angular/flex-layout/flex"

node_modules/@angular-material-extensions/google-maps-autocomplete/fesm2022/angular-material-extensions-google-maps-autocomplete.mjs:13:20:
  13 │ import * as i3 from '@angular/flex-layout/flex';
     ╵                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can mark the path "@angular/flex-layout/flex" as external to exclude it from the bundle, which
will remove this error and leave the unresolved path in the bundle.

X [ERROR] Could not resolve "@angular/flex-layout"

node_modules/@angular-material-extensions/google-maps-autocomplete/fesm2022/angular-material-extensions-google-maps-autocomplete.mjs:16:33:
  16 │ import { FlexLayoutModule } from '@angular/flex-layout';
     ╵                                  ~~~~~~~~~~~~~~~~~~~~~~

You can mark the path "@angular/flex-layout" as external to exclude it from the bundle, which will
remove this error and leave the unresolved path in the bundle.

Desired functionality

Compile without any error.

Mention any other details that might be useful

I have recently upgraded to Angular 19 and updated all dependency to latest version as well. I did not had @angular/flex-layout installed previously. Based on npm, @angular/flex-layout has been deprecated, therefore, I did not installed it. I do not wish to install it if it not required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions