question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

extend is not a function (v 2.7.0)

See original GitHub issue

Hi, we’re using ng2-charts (v 1.6.0) which has dependency on chart.js Everything was working fine - that is, until the last release. Now we’re getting

    TypeError: uF.extend is not a function
    at core.element.js:61
    at main-aot.js:3

The problem occurs with AoT build using rollup. Rollup config:

import rollup      from 'rollup';
import nodeResolve from 'rollup-plugin-node-resolve';
import commonjs    from 'rollup-plugin-commonjs';
import uglify      from 'rollup-plugin-uglify';
import includePaths from 'rollup-plugin-includepaths';

export default {
    entry: '../ClientApp/account/dashboard/main-aot.js',
    dest: '../ClientApp/account/dashboard/bundle.js',
    sourceMap: true,    
    format: 'iife',
    plugins: [
        includePaths({
        include: {},
        paths: ['../ClientApp'],
        external: [],
        extensions: ['.js']
    }),
        nodeResolve({jsnext: true, module: true}),
        commonjs({
            include: [
                '../node_modules/rxjs/**', 
                '../node_modules/email-addresses-custom/lib/**', 
                '../node_modules/jstz-custom/**', 				
                '../node_modules/rxjs/**',				
                '../node_modules/chart.js/**',
                '../node_modules/chartjs-color/**',
                '../node_modules/chartjs-color-string/**',
                '../node_modules/color-convert/**',
                '../node_modules/color-name/**',
                '../node_modules/ng2-charts/**'          
            ],
            namedExports: {
                '../node_modules/chart.js/dist/Chart.js': ['chart.js'],
                '../node_modules/ng2-charts/ng2-charts.js': ['ChartsModule']
            }
        }),
        uglify()
    ]
}

Environment

  • Chart.js version: 2.7.0
  • Browser name and version: Chrome 60.0.3112

I am not sure whether is it problem with chart.js or just rollup config.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:16 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
roman-17commented, Sep 26, 2017

@imranmomin - for the time being, we’re just using older version of chart.js - replacing whole folders of chart.js, chartjs-color and chartjs-color-string in node_modules (not so sure about necessity of replacing the last two, but it doesn’t hurt)

It’s far from ideal though…

0reactions
supasuscommented, Oct 24, 2021

Any fix? I get this when trying to use chartjs-plugins-datasource. It breaks on Chart.helpers.extend

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vue.js Uncaught TypeError: _vueChartjs.Line.extend is not a ...
Syntax for creating chart component has been changed in the latest version ( 3.0.0 ) of vue-chartjs, hence the error occurred.
Read more >
Vue 2.7 is Now in Beta
We are happy to announce that Vue 2.7 is now in beta. Despite Vue 3 now being the default version, we understand that...
Read more >
Guides - Moment.js
The guides area is designed to help developers learn to better interact with the date and time problem domain, and the Moment.js library....
Read more >
Uncaught TypeError | Is Not A Function | Solution - YouTube
Have you encountered an error like:- Uncaught TypeError- Some selector is not a function - jQuery is not a function - owlCarousel is...
Read more >
Changelog | Meteor API Docs
Remove underscore from package-version-parser PR by harryadel. ... Updated meteor-developer-oauth to use async functions. ... standard-minifier-js@2.7.0.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found