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

Cannot find interface defined in api/server/models.ts #1

Open
rgal75 opened this issue Oct 6, 2017 · 6 comments
Open

Cannot find interface defined in api/server/models.ts #1

rgal75 opened this issue Oct 6, 2017 · 6 comments

Comments

@rgal75
Copy link

rgal75 commented Oct 6, 2017

Starting out from the project at master, I tried to add some more features and found that if I start using interface types then webpack is complaining that it cannot find the interface.

How to reproduce:

  1. Start from the angularcli-meteor project at master
  2. In app.component.ts at line 17, add the correct typing (Chat) to the callback parameter. (The Chat interface is already imported.)
...
ngOnInit() {
    Chats.find({}).subscribe((chats: Chat[]) => {
      console.log(chats);
      this.chats = chats;
    });
  }
...
  1. Run npm run start

Result:

ERROR in .../angularcli-meteor-master/src/app/app.component.ts (17,38): Cannot find name 'Chat'.

Note

Thanks for your efforts to create this boilerplate. It's really useful.

@darkbasic
Copy link
Owner

Yeah, I noticed that but I still didn't have the time to investigate. I will probably start migrating the whole Ionic2CLI-meteor tutorial to angularcli in a couple of weeks, so I will have a look.

@mucahittekin
Copy link

mucahittekin commented Oct 7, 2017

@rgal75 I think you should remove baseUrl from src/tsconfig.app.json file.

@rgal75
Copy link
Author

rgal75 commented Oct 8, 2017

@mucahittekin I tried that but unfortunately it does not work.

@darkbasic
Copy link
Owner

First of all: let's remove declare module '*' from src/declarations.d.ts which hides useful warnings for no reason.

The issue is that webpack aliases do not work with angular-cli and I don't know why. They had their own solution with awesome-typescript-loader, but they now removed it to switch to AotPlugin from @ngtools/webpack.

Unfortunately I still didn't manage to make it work: angular/angular-cli#1465 (comment)

@darkbasic
Copy link
Owner

For the moment I simply removed the alias and used relative paths.

@rgal75
Copy link
Author

rgal75 commented Oct 18, 2017

This is what I also ended up eventually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants