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

i18n - fs.relative is not a function #19005

Closed
janousek opened this issue Oct 8, 2020 · 4 comments · Fixed by #19009
Closed

i18n - fs.relative is not a function #19005

janousek opened this issue Oct 8, 2020 · 4 comments · Fixed by #19009

Comments

@janousek
Copy link

janousek commented Oct 8, 2020

🐞 bug report

Affected Package

The issue is caused by package @angular/localize (10.1.5)

Is this a regression?

Yes, the previous version in which this bug was not present was: 10.1.4

Description

I18n extraction fails with the error "fs.relative is not a function".

The problem is with change angular/angular#39006 . It uses API from this commit: 1c4d358 . But this commit was merged only into v11.x.x. Not into 10.x.x. Therefore function "resolve" does not exist.

🔥 Exception or Error

ERROR in ./SubjectCommon/js/services/PaymentService.ts
Module build failed (from E:/reenio/master/src/ClientSide/node_modules/@angular-devkit/build-angular/src/extract-i18n/ivy-extract-loader.js):
TypeError: E:\reenio\master\src\ClientSide\Angular\projects\Subject\SubjectCommon\js\services\PaymentService.js: fs.relative is not a function
    at getFileFromPath (E:\reenio\master\src\ClientSide\node_modules\@angular\localize\src\tools\src\source_file_utils.js:406:107)
    at getLocation (E:\reenio\master\src\ClientSide\node_modules\@angular\localize\src\tools\src\source_file_utils.js:382:20)
    at E:\reenio\master\src\ClientSide\node_modules\@angular\localize\src\tools\src\source_file_utils.js:182:60
    at Array.map ()
    at Object.unwrapMessagePartsFromTemplateLiteral (E:\reenio\master\src\ClientSide\node_modules\@angular\localize\src\tools\src\source_file_utils.js:182:34)
    at PluginPass.TaggedTemplateExpression (E:\reenio\master\src\ClientSide\node_modules\@angular\localize\src\tools\src\extract\source_files\es2015_extract_plugin.js:24:69)
    at newFn (E:\reenio\master\src\ClientSide\node_modules\@babel\traverse\lib\visitors.js:175:21)
    at NodePath._call (E:\reenio\master\src\ClientSide\node_modules\@babel\traverse\lib\path\context.js:55:20)
    at NodePath.call (E:\reenio\master\src\ClientSide\node_modules\@babel\traverse\lib\path\context.js:42:17)
    at NodePath.visit (E:\reenio\master\src\ClientSide\node_modules\@babel\traverse\lib\path\context.js:92:31)
    at TraversalContext.visitQueue (E:\reenio\master\src\ClientSide\node_modules\@babel\traverse\lib\context.js:112:16)
    at TraversalContext.visitSingle (E:\reenio\master\src\ClientSide\node_modules\@babel\traverse\lib\context.js:84:19)
    at TraversalContext.visit (E:\reenio\master\src\ClientSide\node_modules\@babel\traverse\lib\context.js:140:19)
    at Function.traverse.node (E:\reenio\master\src\ClientSide\node_modules\@babel\traverse\lib\index.js:82:17)
    at NodePath.visit (E:\reenio\master\src\ClientSide\node_modules\@babel\traverse\lib\path\context.js:99:18)
    at TraversalContext.visitQueue (E:\reenio\master\src\ClientSide\node_modules\@babel\traverse\lib\context.js:112:16)
 @ ./SubjectCommon/js/controllers/credit/payment-result-controller.component.ts 4:0-86 6:0-75 40:167-184 41:181-195 57:28-42 67:38-55
 @ ./SubjectCommon/js/controllers/credit/credit.module.ts
 @ ./SubjectCommon/js/routes.ts
 @ ./SubjectCommon/js/AppModule.ts
 @ ./SubjectCommon/js/main.ts
 @ multi ./SubjectCommon/js/main.ts




🌍 Your Environment

Angular Version:

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1001.4
@angular-devkit/build-angular   0.1001.5
@angular-devkit/core            10.1.5
@angular-devkit/schematics      10.1.5
@ngtools/webpack                10.1.5
@schematics/angular             10.1.5
@schematics/update              0.1001.5
rxjs                            6.6.3
typescript                      4.0.3
webpack                         4.44.2




Anything else relevant?

@petebacondarwin
Copy link
Member

This change to @angular/localize was included in the 10.1.5 release. See angular/angular@1b5f6ee and angular/angular@669e075.

I think the problem is that the CLI side of things only landed in master: #18908.

Transferring this issue to the CLI repo.

@alan-agius4
Copy link
Collaborator

Closed via #19009

@kyliau
Copy link
Contributor

kyliau commented Oct 8, 2020

This has been fixed and released in v10.1.6: https://github.com/angular/angular-cli/releases/tag/v10.1.6

@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 Nov 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.