Skip to content

Dynamic require of "google-protobuf" is not supported #26833

Closed
@ivegotwings

Description

@ivegotwings

Command

serve

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

16.0.0

Description

The error comes when we call the loadFormFields method in the project/schema library. This used to work perfectly fine in version 16. The demo project resembles the structure of the real project that we work on, so we cannot make changes to the code structure or remove the function call.

Minimal Reproduction

  1. run- npm run start
  2. launch the browser
  3. open console

minimal reproduction depo project- https://github.com/ivegotwings/angularclibug

Exception or Error

`
chunk-XD6TBTUO.js:12 Uncaught Error: Dynamic require of "google-protobuf" is not supported
    at chunk-XD6TBTUO.js:12:9
    at projects/schema/src/lib/model/pbjs/extschema/ves.io/schema/errors_pb.js (errors_pb.js:11:12)
    at __require2 (chunk-XD6TBTUO.js:21:50)
    at index.ts:3:15
`

Your Environment

Angular CLI: 17.0.9
Node: 20.10.0
Package Manager: npm 10.2.3
OS: darwin x64

Angular: 17.0.8
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1700.9
@angular-devkit/build-angular   17.0.9
@angular-devkit/core            17.0.9
@angular-devkit/schematics      17.0.9
@angular/cli                    17.0.9
@schematics/angular             17.0.9
rxjs                            7.8.1
typescript                      5.2.2
zone.js                         0.14.2

Anything else relevant?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions