Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with build library package #22129

Closed
Obliczeniowo opened this issue Nov 9, 2021 · 7 comments · Fixed by #22135
Closed

Problem with build library package #22129

Obliczeniowo opened this issue Nov 9, 2021 · 7 comments · Fixed by #22135
Assignees
Labels
area: @schematics/angular freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Milestone

Comments

@Obliczeniowo
Copy link

Which @angular/* package(s) are the source of the bug?

Don't known / other

Is this a regression?

No

Description

I have problem with build my library made in angular 12 and upgrade to angular 13

I know this is related to package.json: file of sub package:

{
  "ngPackage": {
    "lib": {
      "entryFile": "public-api.ts",
      "umdModuleIds": {
        "@angular/common": "@angular/common",
        "@angular/core": "@angular/core"
      }
    }
  },
  "dependencies": {
    "tslib": "^2.0.0"
  }
}

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

Configuration doesn't match the required schema.
Data path "/lib" must NOT have additional properties (umdModuleIds).


### Please provide the environment you discovered this bug in

```true
Angular cli 13

Anything else?

No response

@JoostK JoostK transferred this issue from angular/angular Nov 9, 2021
@petebacondarwin
Copy link
Contributor

This sounds like a problem with how ng-packagr has been configured.

@petebacondarwin
Copy link
Contributor

In fact I think the problem you have is that in v13 we no longer generate UMD bundles so the umdModuleIds property is no longer valid. See https://github.com/ng-packagr/ng-packagr/blob/f7f1d0232780b531fc48631ff78d8d030d5501d5/CHANGELOG.md#1300-2021-11-03

@clydin
Copy link
Member

clydin commented Nov 9, 2021

As noted above, the umdModuleIds is not a valid option when using v13 as UMD files are no longer generated during builds. The update process should have executed a migration to removed the option. Was the project updated to v13 via the ng update command?

@alan-agius4
Copy link
Collaborator

The migration doesn’t handle ng-packagr configurations in package.json.

We should fix this and we should also deprecate such configurations. The package.json isn’t the right place to configure tools.

@alan-agius4 alan-agius4 added area: @schematics/angular freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix labels Nov 9, 2021
@ngbot ngbot bot modified the milestone: Backlog Nov 9, 2021
@Obliczeniowo
Copy link
Author

hm I try solution like:

{
  "entryFile": "public-api.ts",
  "perDependences": {
    "@angular/common": "@angular/common",
    "@angular/core": "@angular/core"
  },
  "dependencies": {
    "tslib": "^2.0.0"
  }
}

but then it's build in incorrect way

Can you point me how correctly update library with multiple entry points?

@Obliczeniowo
Copy link
Author

As noted above, the umdModuleIds is not a valid option when using v13 as UMD files are no longer generated during builds. The update process should have executed a migration to removed the option. Was the project updated to v13 via the ng update command?

I use:

npx @angular/cli@13 update @angular/core@13 @angular/cli@13

@alan-agius4 alan-agius4 self-assigned this Nov 10, 2021
clydin pushed a commit that referenced this issue Nov 10, 2021
…e.json

Currently ng-packagr, can be configured used in package.json. Previously, the migration didn't handle this case.

Closes #22129

(cherry picked from commit e9d2d98)
clydin pushed a commit that referenced this issue Nov 10, 2021
…e.json

Currently ng-packagr, can be configured used in package.json. Previously, the migration didn't handle this case.

Closes #22129
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Dec 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: @schematics/angular freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants