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

Trying to resolve module in object literal #6498

Closed
debasispanda opened this issue May 29, 2017 · 2 comments · Fixed by #12503
Closed

Trying to resolve module in object literal #6498

debasispanda opened this issue May 29, 2017 · 2 comments · Fixed by #12503
Labels
effort2: medium (days) P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent severity2: inconvenient type: bug/fix

Comments

@debasispanda
Copy link

Bug Report

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

OS- Windows 10
IDE- Visual Studio 2015
node --version = v 7.7.4
Package manager- npm
npm--version = v 4.1.2
ng --version =

@angular/cli: 1.0.1
node: 7.7.4
os: win32 x64
@angular/animations: 4.1.3
@angular/common: 4.1.3
@angular/compiler: 4.1.3
@angular/core: 4.1.3
@angular/forms: 4.1.3
@angular/http: 4.1.3
@angular/platform-browser: 4.1.3
@angular/platform-browser-dynamic: 4.1.3
@angular/router: 4.1.3
@angular/cli: 1.0.1
@angular/compiler-cli: 4.1.3

Repro steps.

  • Create a new app using angular cli.
  • Add the following code to app.component.ts.
let data: any = {
      templateUrl: ''
    }
  • Run ng serve

You will get the following error.

The log given by the failure.

ERROR in ./src/app/app.component.ts
Module not found: Error: Can't resolve './' in 'D:\DemoProjects\demo-app\src\app'
 @ ./src/app/app.component.ts 24:22-35
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts

Desired functionality.

It should be normal string value.

Mention any other details that might be useful.

Unable to reproduce the same issue in plunker as there we have systemjs config.

@clydin
Copy link
Member

clydin commented May 29, 2017

Currently, if either templateUrl or styleUrls is used as described, you will receive the error indicated. There is ongoing work to fix this. However, for now, the only option is to not use those exact names in the manner described.

@sumitarora sumitarora self-assigned this May 29, 2017
@filipesilva filipesilva added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent severity2: inconvenient effort2: medium (days) labels Jun 1, 2017
vikerman pushed a commit that referenced this issue Nov 8, 2018
…orators (#12503)

At the moment we are processing all property assignments in object literals irrespective if they are in a decorator or not. With this change we will process only property assignments found under in a component decorator.

Fixes #12488, Fixes #6007, Fixes: #6498 and Fixes: #8295
@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 Sep 8, 2019
ikjelle pushed a commit to ikjelle/angular-cli that referenced this issue Mar 26, 2024
…orators (angular#12503)

At the moment we are processing all property assignments in object literals irrespective if they are in a decorator or not. With this change we will process only property assignments found under in a component decorator.

Fixes angular#12488, Fixes angular#6007, Fixes: angular#6498 and Fixes: angular#8295
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
effort2: medium (days) P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent severity2: inconvenient type: bug/fix
Projects
None yet
4 participants