Error: Unexpected value 'TruncateModule' imported by the module 'AppModule' #1079

Closed
opened 2025-08-09 17:18:47 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @mskuratowski on 1/28/2017

Hi,

I would like to use [ng2-truncate](https://www.npmjs.com/package/ng2-truncate) but I'm getting an error:

Exception: Call to Node module failed with error: Error: Unexpected value 'TruncateModule' imported by the module 'AppModule'

Here's some part of my code:

package.json
"ng2-truncate": "^1.3.2" -> added in dependencies section

app.module.ts

import { TruncateModule } from 'ng2-truncate';
@NgModule({
    bootstrap: [AppComponent],
    //more components
    imports: [
        UniversalModule, // Must be first import. This automatically imports BrowserModule, HttpModule, and JsonpModule too.
        TruncateModule,
       //more modules
    ]
})

webpack.config.vendor.js

...
    entry: {
        vendor: [
            ...
            'ng2-truncate',
           ....
        ]
..

Do you know what it's wrong?

*Originally created by @mskuratowski on 1/28/2017* Hi, I would like to use \[ng2-truncate](https://www.npmjs.com/package/ng2-truncate) but I'm getting an error: > Exception: Call to Node module failed with error: Error: Unexpected value 'TruncateModule' imported by the module 'AppModule' Here's some part of my code: _package.json_ `"ng2-truncate": "^1.3.2" -> added in dependencies section` _app.module.ts_ ``` import { TruncateModule } from 'ng2-truncate'; @NgModule({ bootstrap: [AppComponent], //more components imports: [ UniversalModule, // Must be first import. This automatically imports BrowserModule, HttpModule, and JsonpModule too. TruncateModule, //more modules ] }) ``` _webpack.config.vendor.js_ ``` ... entry: { vendor: [ ... 'ng2-truncate', .... ] .. ``` Do you know what it's wrong?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#1079
No description provided.