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

Migration to v13 throws exception with ng-package.js #22107

Closed
1 of 15 tasks
duykhang53 opened this issue Nov 6, 2021 · 1 comment · Fixed by #22117
Closed
1 of 15 tasks

Migration to v13 throws exception with ng-package.js #22107

duykhang53 opened this issue Nov 6, 2021 · 1 comment · Fixed by #22117
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

@duykhang53
Copy link

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

No

Description

Failed migration from angular v12 to angular v13 for library project using js as ng-pacakgr

🔬 Minimal Reproduction

Migrate an angular library from v12 to v13 that contain js file for ng-packagr configuration (ng-package.js) then run
ng update --force --allow-dirty @angular/cli --from 12 --migrate-only

🔥 Exception or Error

[error] Error: Failed to parse "__/ng-package.prod.js" as JSON AST Object. InvalidSymbol at location: 0.
    at JSONFile.get JsonAst [as JsonAst] (__\node_modules\@angular\cli\node_modules\@schematics\angular\utility\json-file.js:39:19)
    at JSONFile.get (__\node_modules\@angular\cli\node_modules\@schematics\angular\utility\json-file.js:44:34)
    at JSONFile.remove (__\node_modules\@angular\cli\node_modules\@schematics\angular\utility\json-file.js:75:18)
    at __\node_modules\@angular\cli\node_modules\@schematics\angular\migrations\update-13\update-libraries.js:68:22

🌍 Your Environment




     _                      _                 ____ _     ___ 
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | | 
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | | 
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 13.0.1
Node: 16.10.0
Package Manager: npm 7.24.0
OS: win32 x64

Angular: 13.0.0
... animations, cdk, common, compiler, compiler-cli, core, forms
... language-service, material, platform-browser
... platform-browser-dynamic, platform-server, router
... service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1300.1
@angular-devkit/build-angular   13.0.1
@angular-devkit/core            12.0.5
@angular-devkit/schematics      12.0.5
@angular/cli                    13.0.1
@nguniversal/builders           12.1.3
@nguniversal/express-engine     12.1.3
@schematics/angular             12.0.5
ng-packagr                      13.0.3
rxjs                            6.6.7
typescript                      4.4.4
@alan-agius4 alan-agius4 self-assigned this Nov 8, 2021
@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 8, 2021
@ngbot ngbot bot added this to the Backlog milestone Nov 8, 2021
clydin pushed a commit that referenced this issue Nov 8, 2021
…onfigurations

Our migrations only handle JSON configs.

Closes #22107

(cherry picked from commit 950b430)
clydin pushed a commit that referenced this issue Nov 8, 2021
…onfigurations

Our migrations only handle JSON configs.

Closes #22107
@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 9, 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.

2 participants