-
Notifications
You must be signed in to change notification settings - Fork 346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncaught TypeError: Super expression must either be null or a function. #379
Comments
Can you send the complete error stack? Is there a possibility of circular dependencies? |
@NightCatSama: Please verify Uncaught TypeError: Super expression must either be null or a function |
Sorry for the late reply. It seems that the problem is not in the component, you can refer to this: |
I tried to use this component in my site that uses requirejs to load all modules. Vue library loads without any problems via requirejs but if i try to load vue-slider umd file as a module it gives me the same error "Uncaught TypeError: Super expression must either be null or a function". Is this any way to use it with requrejs? |
@syberon I don't know why 😢 , using umd specification package should support amd. |
This looks like when i trying to load the module it can not find globally defined Vue.
If i remove the inclusion of vue.js from the code i get the error that in topic of this tread: This is code that i tried to use: index,html
main.js
And this code gets to me the same error on 'vue-slider-component.umd' module loading: It looks like the module tries to find the globally defined (or something else) Vue on load and throws this error if can't find it. |
@syberon Is it because of the loading order problem, you try this? require (['vue'], function (Vue) {
require(['vue-slider-component.umd'], function(VueSlider) {
// new Vue
})
}); |
Yes, i tried this now, but without luck. Component still throw this error. |
@syberon Sorry, I have no clue 🤕 . Do you want to try this? // vue-slider-component.umd.js line: 5
define(['vue'], factory); |
Thanks! This trick worked for me. |
@NightCatSama
After upgrading "vue-slider-component" "2.4.1" to latest 3.0.33, getting error "Uncaught TypeError: Super expression must either be null or a function".
Below are the configuration of My current project.
Node - 10.16.4
Npm - 6.9.0
Yarn - 1.16.0
The text was updated successfully, but these errors were encountered: