Skip to content

Unexpected value 'KernelModule' imported by the module 'DynamicTestModule' #3463

Closed
@avril-verhaeghen

Description

@avril-verhaeghen

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
Windows 7

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:

$ ng version
angular-cli: 1.0.0-beta.21
node: 6.4.0
os: win32 x64
$ node version
v6.4.0

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
Added custom components and custom routings

The log given by the failure.

Chrome 54.0.2840 (Windows 7 0.0.0) Page partenaire list should test true is true FAILED
Failed: Unexpected value 'KernelModule' imported by the module 'DynamicTestModule'
Error: Unexpected value 'KernelModule' imported by the module 'DynamicTestModule'
at webpack:///C:/Develop/partenaire-front-end//@angular/compiler/src/metadata_resolver.js:363:0 <- src/test.ts:26654:31
at Array.forEach (native)
at CompileMetadataResolver._loadNgModuleMetadata (webpack:///C:/Develop/partenaire-front-end/
/@angular/compiler/src/metadata_resolver.js:348:0 <- src/test.ts:26639:49)
at CompileMetadataResolver.loadNgModuleMetadata (webpack:///C:/Develop/partenaire-front-end//@angular/compiler/src/metadata_resolver.js:313:0 <- src/test.ts:26604:29)
at RuntimeCompiler._loadModules (webpack:///C:/Develop/partenaire-front-end/
/@angular/compiler/src/runtime_compiler.js:99:0 <- src/test.ts:43055:41)
at RuntimeCompiler._compileModuleAndAllComponents (webpack:///C:/Develop/partenaire-front-end//@angular/compiler/src/runtime_compiler.js:83:0 <- src/test.ts:43039:35)
at RuntimeCompiler.compileModuleAndAllComponentsAsync (webpack:///C:/Develop/partenaire-front-end/
/@angular/compiler/src/runtime_compiler.js:65:0 <- src/test.ts:43021:21)
at TestingCompilerImpl.compileModuleAndAllComponentsAsync (webpack:///C:/Develop/partenaire-front-end//@angular/compiler/bundles/compiler-testing.umd.js:485:0 <- src/test.ts:65925:35)
at TestBed.compileComponents (webpack:///C:/Develop/partenaire-front-end/
/@angular/core/bundles/core-testing.umd.js:745:0 <- src/test.ts:14955:35)
at Function.TestBed.compileComponents (webpack:///C:/Develop/partenaire-front-end/~/@angular/core/bundles/core-testing.umd.js:648:49 <- src/test.ts:14858:71)
Chrome 54.0.2840 (Windows 7 0.0.0): Executed 1 of 1 (1 FAILED) ERROR (0.159 secs / 0.019 secs)

Mention any other details that might be useful.

The KernelModule is for the moment a custom made Angular2 webpack app that we host on Bitbucket, so it's being installed by the other app which is now an angular-cli app. And there I want to perform my UT. This KernelModule will be migrated in the near future to angular-cli too.

The meaning behind KernelModule is that it will share other component.

Metadata for this one is:

@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    BrowserModule,
    ReactiveFormsModule,

    /**
     * KendoUI Modules
     */
    GridModule
  ],
  declarations: [
    KernelBoxComponent,

    /**
     * Based on KendoUI
     */
    KernelTableComponent,
    KernelTableHeaderComponent
  ],
  exports: [
    CommonModule,
    FormsModule,
    BrowserModule,
    ReactiveFormsModule,

    KernelBoxComponent,

    /**
     * Based on KendoUI
     */
    KernelTableComponent,
    KernelTableHeaderComponent
  ]
})

I'm guessing that it could be either because the KernelModule is not build correctly, or (but this is a long shot) KernelModule is for now webpack? I'm thinking about these because once I copied the KernelBoxComponent and pasted into my project and used the component directly instead of the module, there wasn't a problem for doing my tests. BUT when I used the component directly from the my custom made webpack app, then I got other errors.


Thanks! We'll be in touch soon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions