Comments (18)
@MetaVurt Thanks! I published that change as 1.5.2 see 8f03307
from ng2-nouislider.
A radical workaround is to use replace the library by the file https://github.com/tb/ng2-nouislider/blob/master/src/nouislider.ts. Just copy it somewhere in your source folder and remove the library from the packages.json until the bug has been fixed.
from ng2-nouislider.
I can confirm
Adding "@ngtools/webpack": "1.2.3" to package.json resolved this issue for me.
I don't think this issue should be closed though. We shouldn't have to add this to our package.json. The dependencies for this package (ng2-nouislider) should be setup correctly to solve this issue.
from ng2-nouislider.
Can confirm. Am getting same error with simple ng build --prod. Error specifically points to ng2-nouislider's ts.
ERROR in ./~/ng2-nouislider/src/nouislider.ts
Module build failed: TypeError: Cannot read property 'text' of undefined
I'm digging into it right now, and I will add my two cents' worth that yes, when releasing, either things like this should be clarified in the instructions on a readme, or should be resolved within the package itself. I recognize that the landscape is still changing rapidly these days, but it is worth it to communicate upfront that a little housekeeping may be necessary to get a particular directive to work in any one person's production environment.
I will post any updates if I find a working case that isn't a hack.
from ng2-nouislider.
Rock n roll, @tb, glad to be of help!
from ng2-nouislider.
I see the same issue
from ng2-nouislider.
Same here. +1
from ng2-nouislider.
Adding "@ngtools/webpack": "1.2.3" to package.json resolved this issue for me.
from ng2-nouislider.
Same here. +1
from ng2-nouislider.
@tb Maybe the discussion in this tickets helps you to solve bug bug. Among other things, it mentions what causes this (or a similar) bug: angular/angular-cli#4072
from ng2-nouislider.
@rerickson1 @kkotak did you add @ngtools/webpack as a dev dependency? It still throws the same error for me :(
@angular/[email protected]
@ngtools/[email protected]
[email protected]
from ng2-nouislider.
@rsquared-digital, Yes I have under dev. I also have "@angular/cli": "1.0.0-beta.30", which might also be relevant.
from ng2-nouislider.
@rsquared-digital I have it under dev as well. Here is my package.json content:
"dependencies": {
"@angular/common": "2.4.3",
"@angular/compiler": "2.4.3",
"@angular/core": "2.4.3",
"@angular/forms": "2.4.3",
"@angular/http": "2.4.3",
"@angular/platform-browser": "2.4.3",
"@angular/platform-browser-dynamic": "2.4.3",
"@angular/router": "3.4.3",
"angular-in-memory-web-api": "^0.2.4",
"angular2-jwt": "^0.1.27",
"angular2-ui-switch": "^1.2.0",
"bootstrap": "~3.3.7",
"core-js": "^2.4.1",
"jquery": "~3.1.1",
"jsen": "^0.6.4",
"jsrsasign": "^6.2.3",
"ng2-bootstrap": "^1.3.1",
"ng2-nouislider": "^1.5.0",
"nouislider": "^9.2.0",
"rxjs": "^5.0.1",
"ts-helpers": "^1.1.1",
"zone.js": "^0.7.2"
},
"devDependencies": {
"@angular/cli": "1.0.0-beta.30",
"@angular/compiler-cli": "2.4.3",
"@ngtools/webpack": "1.2.3",
"@types/jasmine": "2.5.38",
"@types/jsen": "0.0.18",
"@types/node": "^6.0.42",
"codelyzer": "~2.0.0-beta.1",
"jasmine-core": "2.5.2",
"jasmine-spec-reporter": "2.5.0",
"karma": "1.2.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.2.1",
"protractor": "~4.0.13",
"ts-node": "1.2.1",
"tslint": "^4.3.0",
"typescript": "~2.0.3"
}
from ng2-nouislider.
Check your typescript version. Mine is 2.1.5. Other than that, I'm not sure.
from ng2-nouislider.
I am having the same issue while building my project in production mode ng build --prod
and after removing the ng2-nouislider everything works fine.
Typescript: 2.1.6 or 2.2.1
@angular/cli: 1.0.0-rc.0
@ngtools/webpack: 1.2.5 or 1.2.11
Any work around please, I need to deploy production version??
from ng2-nouislider.
@stephanrauh thanks, it works. Confirmed
from ng2-nouislider.
SOLVED
Per @emoralesb05 in this conversation, which is a closed, open again conversation, what seems to be the issue are source ts files being included in the delivered package, thereby tripping up the build script(s) of angular-cli.
I literally went into
node_modules/ng2-nouislider/src/
and removed
nouislider.ts
I am now able to:
npm build --prod
npm build --prod --aot
My current setup is the following:
@angular/cli: 1.0.0-rc.0
node: 7.4.0
os: darwin x64
@angular/common: 2.4.8
@angular/compiler: 2.4.8
@angular/core: 2.4.8
@angular/forms: 2.4.8
@angular/http: 2.4.8
@angular/material: 2.0.0-beta.2
@angular/platform-browser: 2.4.8
@angular/platform-browser-dynamic: 2.4.8
@angular/router: 3.4.8
@angular/cli: 1.0.0-rc.0
@angular/compiler-cli: 2.4.8
I upgraded my build following the Upgrade Steps from the Angular-CLI team, listed here.
I do not apparently have any reason to cut/paste a reference to @ngtools/webpack in package.json, as listed here.
Here are my dependencies and dev dependencies, for anyone's reference:
"dependencies": {
"@angular/common": "^2.4.8",
"@angular/compiler": "^2.4.8",
"@angular/core": "^2.4.8",
"@angular/forms": "^2.4.8",
"@angular/http": "^2.4.8",
"@angular/material": "^2.0.0-beta.2",
"@angular/platform-browser": "^2.4.8",
"@angular/platform-browser-dynamic": "^2.4.8",
"@angular/router": "^3.4.8",
"core-js": "^2.4.1",
"ng2-nouislider": "^1.5.1",
"nouislider": "^9.2.0",
"rxjs": "^5.2.0",
"zone.js": "^0.7.7"
},
"devDependencies": {
"@angular/cli": "^1.0.0-rc.0",
"@angular/compiler-cli": "^2.4.8",
"@types/jasmine": "2.5.43",
"@types/node": "~7.0.5",
"codelyzer": "~3.0.0-beta.0",
"jasmine-core": "~2.5.2",
"jasmine-spec-reporter": "~3.2.0",
"karma": "~1.5.0",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^0.2.3",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.1.1",
"ts-node": "~2.1.0",
"tslint": "~4.4.2",
"typescript": "~2.2.1"
}
And in the app itself, I only use the following -
app.module.ts
import { NouisliderModule } from 'ng2-nouislider';
imports: [
BrowserModule,
FormsModule,
HttpModule,
ReactiveFormsModule,
NouisliderModule,
MaterialModule.forRoot(),
RouterModule.forRoot(ROUTES)
],
I use the ui slider in a child component, with no other import code being needed.
I truly hope this helps everyone get back on track.
from ng2-nouislider.
I can confirm --prod build is now working. Thanks!
from ng2-nouislider.
Related Issues (20)
- suddenly started having error TS2305: Module '"../../node_modules/ng2-nouislider/ng2-nouislider"' has no exported member 'NouisliderModule'. HOT 4
- How to find which handle is being dragged in custom event? HOT 2
- Return all parameters in event HOT 2
- Materialize design
- Component does not work with formControlName attribute HOT 3
- Error when setting start with the value of a variable. HOT 1
- Angular 9 support HOT 1
- Angular Build WARNING - depends on 'nouislider'. CommonJS or AMD dependencies can cause optimization bailouts. For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies HOT 4
- Slider snaps on manually setting a value between steps HOT 3
- TypeError: Cannot read property 'from' of undefined at NouisliderComponent.toValues HOT 1
- Potentially not compatible with Ivy warning HOT 1
- ng2-nouislider vertical, direction rtl issue HOT 1
- Add handles dynamically in reactive form
- Keyboard support handle issue when multi connect option is used. HOT 1
- The website is blocked in India HOT 1
- Angualr 12/13/14 new lib format HOT 1
- is this lib dead ? HOT 2
- Angular 14 [(ngModel])
- NouisliderModule does not have a module def (ɵmod property) for Angular16 HOT 1
- Disabled attribute doesnt work as expected HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ng2-nouislider.