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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect error message: Could not resolve /my/missing/import relative to [object Object] #30832

Closed
dejoean opened this issue Jun 3, 2019 · 5 comments
Labels
area: compiler Issues related to `ngc`, Angular's template compiler freq1: low needs: clarification This issue needs additional clarification from the reporter before the team can investigate. needs reproduction This issue needs a reproduction in order for the team to investigate further P5 The team acknowledges the request but does not plan to address it, it remains open for discussion regression Indicates than the issue relates to something that worked in a previous version state: confirmed type: bug/fix
Milestone

Comments

@dejoean
Copy link

dejoean commented Jun 3, 2019

馃悶 bug report

Affected Package

The issue is caused by package @angular/compiler

Is this a regression?

Yes, the previous version in which this bug was not present was: prior to pull 26759

Description

On line 423-424 in static_symbol_resolver in pull 26759 the following line was changed to call self.host.getMetadataFor on the filepath. This change causes the returned value to be an object, which is then inserted into the template string, producing the output [object Object].

message:
  `Could not resolve ${module} relative to ${self.host.getMetadataFor(sourceSymbol.filePath)}.`,

On a separate note the period at the end of the statement is duplicated when it is logged out so it could be removed here.

馃敩 Minimal Reproduction

Can be reproduced by forcing the relevant error to be thrown, or simply taking the template string provided and passing it any object type where self.host.getMetadataFor(sourceSymbol.filePath) is.

馃敟 Exception or Error

Could not resolve /my/missing/import relative to [object Object]

馃實 Your Environment

Angular Version: 8.1.0-beta.0

Anything else relevant? Google Environment

@mhevery mhevery added area: core Issues related to the framework runtime regression Indicates than the issue relates to something that worked in a previous version labels Jun 4, 2019
@ngbot ngbot bot added this to the needsTriage milestone Jun 4, 2019
@alxhub alxhub added freq1: low needs reproduction This issue needs a reproduction in order for the team to investigate further type: bug/fix labels Jun 4, 2019
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Jun 4, 2019
@alxhub
Copy link
Member

alxhub commented Jun 4, 2019

Hello @joe-denea,

Thank you for tracking down the PR which caused this. Can you also include a reproduction - a repository with code that produces the error, and instructions on how to run the build? Without a reproduction it's difficult for us to both identify the issue and to verify that it's fixed.

@dejoean
Copy link
Author

dejoean commented Jun 5, 2019

Hey @alxhub

I already identified the issue in the actual code. getMetaDataFor returns an object type and that return value is being directly inserted into an ES6 template literal, producing the output [object Object]. Any object inserted into a template literal will produce this output and thus any return value generated by getMetaDataFor will produce this output. There is nothing else I could make clear by creating a repro repository, the entire issue is that `${{}}` = '[object Object]' so the code I referenced is fundamentally incorrect. Likely the intent was to access a particular property of the returned metadata object to get a relative path or something. You might have a better idea what the intent was since you wrote the PR in question.

@pkozlowski-opensource pkozlowski-opensource added area: compiler Issues related to `ngc`, Angular's template compiler and removed area: core Issues related to the framework runtime labels Feb 8, 2020
@alxhub
Copy link
Member

alxhub commented Feb 28, 2020

@joe-denea

Likely the intent was to call self.host.getOutputName instead of self.host.getMetadataFor.

Given that this is in View Engine code, I'm inclined to close this as the metadata system is going away in its entirety with Ivy, and without a reproduction demonstrating the issue it would take me too long to develop a test for the admittedly trivial fix.

@jelbourn jelbourn added P2 The issue is important to a large percentage of users, with a workaround and removed P2 The issue is important to a large percentage of users, with a workaround labels Oct 1, 2020
@ngbot ngbot bot modified the milestones: Backlog, needsTriage Oct 1, 2020
@jelbourn jelbourn added the P5 The team acknowledges the request but does not plan to address it, it remains open for discussion label Oct 1, 2020
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Oct 1, 2020
@jelbourn jelbourn added the needs: clarification This issue needs additional clarification from the reporter before the team can investigate. label Oct 1, 2020
@petebacondarwin
Copy link
Member

Closing due to a lack of reproduction, and also since it only affects the deprecated ViewEngine compiler mode.

@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 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: compiler Issues related to `ngc`, Angular's template compiler freq1: low needs: clarification This issue needs additional clarification from the reporter before the team can investigate. needs reproduction This issue needs a reproduction in order for the team to investigate further P5 The team acknowledges the request but does not plan to address it, it remains open for discussion regression Indicates than the issue relates to something that worked in a previous version state: confirmed type: bug/fix
Projects
None yet
Development

No branches or pull requests

6 participants