Skip to content

Invalid metadata.json when multiple barrel exports from packages #24225

Closed

Description

@alan-agius4

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:

Current behavior

When having multiple barrel exports from external packages incorrect metadata file is being generated, as some exports are missing.

Expected behavior

The metadata file contains all exports.

Minimal reproduction of the problem with instructions

Create a .ts file, containing 2 barrel exports example;
tsconfig

  "angularCompilerOptions": {
    "annotateForClosureCompiler": true,
    "skipTemplateCodegen": true,
    "strictMetadataEmit": true,
    "fullTemplateTypeCheck": true,
    "strictInjectionParameters": true,
    "flatModuleId": "index",
    "flatModuleOutFile": "index.js"
  },

public-api.ts

export * from '@angular/common';
export * from '@angular/common/testing';

.metadata.json

{
    "__symbolic": "module",
    "version": 4,
    "exports": [
        {
            "from": "@angular/common/testing"
        }
    ],
    "metadata": {},
    "origins": {},
    "importAs": "AUTOGENERATED"
}

What is the motivation / use case for changing the behavior?

Consumer will have an error

Environment


Angular version: 6.0.2
TypeScript: 2.7.2
Tsickle: 0.27.5


Activity

  1. added
    area: coreIssues related to the framework runtime
    on May 31, 2018
  2. added this to the needsTriage milestone on May 31, 2018
  3. modified the milestones: needsTriage, Backlog on Jun 26, 2018
  4. alxhub commented on Feb 20, 2020

    @alxhub
    Member

    This is fixed in Angular Ivy in v9, as the Ivy compiler completely ignores metadata.json files. Eventually they will cease to exist 🎉

  5. angular-automatic-lock-bot commented on Mar 22, 2020

    @angular-automatic-lock-bot

    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.

  6. locked and limited conversation to collaborators on Mar 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions