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.

Metadata version changed to 2 in 2.2.2, breaking consumers with older versions

See original GitHub issue

I’m submitting a …

[x] bug report
[ ] feature request
[ ] support request

Current behavior Metadata built with Angular >= 2.2.2 comes out with version 2 due to dddbb1c1cb08115f339e34487774c85a3c6493f3. An application with Angular <= 2.2.1 won’t be able to consume this metadata, throwing the following error:

Error: Metadata version mismatch for module /home/local/TELERIK/tsonev/gitlab/angular-aot/node_modules/@progress/kendo-angular-buttons/dist/es/button.service.d.ts, found version 2, expected 1
    at StaticReflector.getModuleMetadata (/home/local/TELERIK/tsonev/gitlab/angular-aot/node_modules/@angular/compiler-cli/src/static_reflector.js:500:23)

Expected behavior Metadata version shouldn’t change in a patch or minor releases.

Minimal reproduction of the problem with instructions Try to consumе this dummy package built with 2.2.2 in a project with 2.2.1. You can see that the metadata is set to version 2.

What is the motivation / use case for changing the behavior? Avoiding breaking changes.

Please tell us about your environment: any

  • Angular version: 2.2.2

  • Browser: all

  • Language: TypeScript 2.x

  • Node (for AoT issues): node --version =

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:12
  • Comments:20 (9 by maintainers)

github_iconTop GitHub Comments

4reactions
tsvetomircommented, Nov 23, 2016

As a package publisher, we don’t know which version of Angular 2 the consumer is using. Yet, we have to ship metadata as part of our packages to make them usable with AoT compilation. This makes metadata part of the public API, albeit indirectly.

Thus we have two choices:

  1. Lock down our packages to 2.2.1 in order to produce v1 metadata. This is usable by all consumers.
  2. Build against the latest stable 2.x release and break users with 2.2.1 and earlier. The semver way to address this situation is to introduce a breaking change in our package with the Angular peer dependency set to >= 2.2.2

You can see where I’m going. If a version of Angular forces us to introduce a breaking change then it must be a breaking change itself.

Welcome to the world of “third-party” vendors 😃

2reactions
tboschcommented, Nov 23, 2016

@bahodirk The problem is that we didn’t pin the version of @angular/tsc-wrapped in @angular/compiler-cli

FYI: Here is the revert PR that should become part of 2.2.3: https://github.com/angular/angular/pull/13067

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - pip has problems with metadata - Stack Overflow
2 ', but metadata has '22.1.2' and pip goes into a download loop trying older and older versions... Dependencies are NP-complete... Ther scr ......
Read more >
Changes — Flask Documentation (2.2.x)
Changes ¶. Version 2.2.3¶. Unreleased. Version 2.2.2¶. Released 2022-08-08. Update Werkzeug dependency to >= 2.2.2. This includes fixes related to the new ...
Read more >
Release Notes — Airflow Documentation
X to 2.X breaking changes. Bug Fixes¶. Fix exception in mini task scheduler (#24865).
Read more >
Release notes & updates – Azure CLI - Microsoft Learn
Synapse. [BREAKING CHANGE] az synapse role assignment create : Role names at old version are not allowed, Sql Admin, Apache Spark Admin ...
Read more >
Changelog • devtools
devtools 2.2.2 ... There have been a number of breaking changes in this release, ... Fix test() compatibility with testthat versions 1.0.2 (#1503)....
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