angular2-template-loader: (0.6.1) path problem

0.6.1 version doesn’t recognize some of my relative paths.

This component

@Component({
	selector: 'home',
	templateUrl: 'home.component.html'
})
export class HomeComponent ...

builds to

HomeComponent = __decorate([
    core_1.Component({
        selector: 'home',
        templateUrl: 'home.component.html'
    }),
    __metadata("design:paramtypes", [router_1.ActivatedRoute])
], HomeComponent);

Looks like loader doesn’t recognize templateUrl path.

When I roll back to 0.6.0 it works fine.

About this issue

  • Original URL
  • State: open
  • Created 7 years ago
  • Reactions: 5
  • Comments: 31 (4 by maintainers)

Most upvoted comments

Going to leave open until I publish fix. Thanks for your patience everyone.

Closing as this is now published, thank you so much for being patient. Also looking for maintainers willing to help.

I encountered what might be the same problem; I found out the problem was that I had a bunch of compiled .js files lying around from running tsc manually. Deleting them resolved the issue, so what was probably happening was webpack was picking those up, rather than the ones output by the loaders. Lesson learned, hopefully this helps someone else.

@GiuseppePiscopo, do any of your other templateUrls have this issue, or is it specific to these two templateUrls, or do you only have two components? It would be good if you could post the full @Component metadata for each of these two cases.

Also, just because why not, have you tried without the ./ at the beginning of the templateUrl?

This should fix it. @dellax as temporary workaround you can add the comma symbol after templateUrl