Skip to content
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

vue.global.js:1855 Uncaught TypeError: t.component is not a function (Vue3, via unpkg.com) #388

Open
doconnor-clintel opened this issue Jun 9, 2023 · 0 comments

Comments

@doconnor-clintel
Copy link

doconnor-clintel commented Jun 9, 2023

For some reason, on rendering, VueSignaturePad is expecting to be passed an instance of the app (which defines app.component), but instead receives the div element being mounted.

<script src="https://unpkg.com/vue@3.2.47/dist/vue.global.js"></script>
<script src="https://unpkg.com/merge-images@2.0.0/dist/index.umd.js"></script>
<script src="https://unpkg.com/signature_pad@4.1.5/dist/signature_pad.umd.js"></script>
<script src="https://unpkg.com/vue-signature-pad@3.0.2/dist/vue-signature-pad.min.js"></script>


<div id="signature" style="width:500px; height: 500px"></div>
<template id="signature-component">
  <div id="app">
    <div class="container">
      <div class="container">
        <vue-signature-pad
          id="signature"
          width="100%"
          height="500px"
          ref="signaturePad"
        />
      </div>
      <div class="buttons">
        <button @click="undo">Undo</button>
        <button @click="save">Save</button>
      </div>
    </div>
  </div>
</template>
<script>

const signatureApp = Vue.createApp({
  name: 'MySignaturePad',
  template: "#signature-component",
  methods: {
    undo() {
      this.$refs.signaturePad.undoSignature();
    },
    save() {
      const { isEmpty, data } = this.$refs.signaturePad.saveSignature();
      console.log(isEmpty);
      console.log(data);
    }
  }
});
signatureApp.component("vue-signature-pad", VueSignaturePad);
signatureApp.mount("#signature");

</script>

Results in

Navigated to file:///home/doconnor/vue.html

vue.global.js:11083 You are running a development build of Vue.
Make sure to use the production build (*.prod.js) when deploying for production.

vue.global.js:1661 [Vue warn]: Unhandled error during execution of render function 
  at <A id="signature" width="100%" height="500px"  ... > 
  at <MySignaturePad>
warn @ vue.global.js:1661
logError @ vue.global.js:1849
handleError @ vue.global.js:1841
renderComponentRoot @ vue.global.js:2556
componentUpdateFn @ vue.global.js:7174
run @ vue.global.js:635
instance.update @ vue.global.js:7288
setupRenderEffect @ vue.global.js:7302
mountComponent @ vue.global.js:7084
processComponent @ vue.global.js:7042
patch @ vue.global.js:6646
mountChildren @ vue.global.js:6829
mountElement @ vue.global.js:6740
processElement @ vue.global.js:6723
patch @ vue.global.js:6643
mountChildren @ vue.global.js:6829
mountElement @ vue.global.js:6740
processElement @ vue.global.js:6723
patch @ vue.global.js:6643
mountChildren @ vue.global.js:6829
mountElement @ vue.global.js:6740
processElement @ vue.global.js:6723
patch @ vue.global.js:6643
componentUpdateFn @ vue.global.js:7181
run @ vue.global.js:635
instance.update @ vue.global.js:7288
setupRenderEffect @ vue.global.js:7302
mountComponent @ vue.global.js:7084
processComponent @ vue.global.js:7042
patch @ vue.global.js:6646
render @ vue.global.js:7802
mount @ vue.global.js:6036
app.mount @ vue.global.js:10995
(anonymous) @ vue.html:43


vue.global.js:1855 Uncaught TypeError: t.component is not a function
    at vue-signature-pad.min.js:1:5978
    at Array.forEach (<anonymous>)
    at A (vue-signature-pad.min.js:1:5928)
    at renderComponentRoot (vue.global.js:2548:21)
    at ReactiveEffect.componentUpdateFn [as fn] (vue.global.js:7174:59)
    at ReactiveEffect.run (vue.global.js:635:27)
    at instance.update (vue.global.js:7288:58)
    at setupRenderEffect (vue.global.js:7302:11)
    at mountComponent (vue.global.js:7084:11)
    at processComponent (vue.global.js:7042:19)
(anonymous) @ vue-signature-pad.min.js:1
A @ vue-signature-pad.min.js:1
renderComponentRoot @ vue.global.js:2548
componentUpdateFn @ vue.global.js:7174
run @ vue.global.js:635
instance.update @ vue.global.js:7288
setupRenderEffect @ vue.global.js:7302
mountComponent @ vue.global.js:7084
processComponent @ vue.global.js:7042
patch @ vue.global.js:6646
mountChildren @ vue.global.js:6829
mountElement @ vue.global.js:6740
processElement @ vue.global.js:6723
patch @ vue.global.js:6643
mountChildren @ vue.global.js:6829
mountElement @ vue.global.js:6740
processElement @ vue.global.js:6723
patch @ vue.global.js:6643
mountChildren @ vue.global.js:6829
mountElement @ vue.global.js:6740
processElement @ vue.global.js:6723
patch @ vue.global.js:6643
componentUpdateFn @ vue.global.js:7181
run @ vue.global.js:635
instance.update @ vue.global.js:7288
setupRenderEffect @ vue.global.js:7302
mountComponent @ vue.global.js:7084
processComponent @ vue.global.js:7042
patch @ vue.global.js:6646
render @ vue.global.js:7802
mount @ vue.global.js:6036
app.mount @ vue.global.js:10995
(anonymous) @ vue.html:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant