angular-meteor icon indicating copy to clipboard operation
angular-meteor copied to clipboard

Cannot find module './app.component.html'

Open BahramSoheili opened this issue 10 years ago • 3 comments

Hi everyone I am so hopeless of using meteor as I have faced lots of unforeseen problems and couldn't learn it. anyway I use socially project and it doesn't let me to use template from my html file: import { Component } from '@angular/core'; import template from './app.component.html'; //problem in here... import { Observable } from 'rxjs/Observable'; import { Parties } from '../../../both/collections/parties.collection'; import { Party } from '../../../both/models/party.model'; @Component({ selector: 'app', template }) export class AppComponent { parties: Observable<Party[]>;

constructor() { this.parties = Parties.find({}).zone(); } removeParty(party: Party): void { Parties.remove(party._id); } }

I have checked it numerously although there is not clear reason for this error: Cannot find module './app.component.html' please help me to learn it.

BahramSoheili avatar Nov 26 '16 23:11 BahramSoheili

The code looks fine to me (assuming you have an app.component.html in the same folder). I sometimes see this sort of error when I add new modules or files. For me, restarting meteor usually fixes it (my guess is that there's something in the build process that is cached that's not being updated).

sdarnell avatar Nov 27 '16 17:11 sdarnell

thank you @sdarnell for your response. of course that 'app.component.html' is in the same folder and resetting meteor couldn't solve this problem anymore.

BahramSoheili avatar Nov 29 '16 00:11 BahramSoheili

I solve it, after running this package: meteor npm install --save babel-runtime

BahramSoheili avatar Nov 29 '16 23:11 BahramSoheili