teambit / bit-angular

Angular support for bit harmony
28 stars 3 forks source link

Cannot find module '@angular/material/button/package.json' #18

Closed CodeNameNinja closed 3 years ago

CodeNameNinja commented 3 years ago

It seems I can't use the modules that Angular Material provides for some reason.

bit version 0.0.469

//workspace.jsonc
...
  "policy": {
      "dependencies": {
        "@angular/material": "12.1.3"
      },
      "peerDependencies": {}
    },
...
"teambit.angular/angular-v12@0.0.22": {},
  "teambit.workspace/variants": {
    "*": {
      // Replace `v12` by the version of Angular that you want to use
      "teambit.angular/angular-v12@0.0.22": {}
    }
  },
  "teambit.generator/generator": {
    "aspects": [
      // Replace `v12` by the version of Angular that you want to use
      "teambit.angular/angular-v12@0.0.22"
    ]
  }

button.module.ts

import { NgModule } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { ButtonComponent } from './button.component';

@NgModule({
  declarations: [
    ButtonComponent
  ],
  imports: [MatButtonModule],
  exports: [
    ButtonComponent
  ]
})
export class ButtonModule {}

Error

I get this error after bit compile and bit install image

My package.json does have @angular/material": "^12.1.3", listed and installed

CodeNameNinja commented 3 years ago

@ocombe can you perhaps assist me again, and help me resolve this issue.

ocombe commented 3 years ago

Hello, you can try version 0.0.27, it should resolve the issue (otherwise let me know)