Unable to run mathlive for VueJS with package from node_module
See original GitHub issueDescription
I still have this problem when i reproduce the example for VueJs
in main.js
import MathLive from 'mathlive/dist/mathlive';
import Mathfield from 'mathlive/dist/vue-mathlive.mjs';
Vue.use(Mathfield, MathLive);
In my math component
<mathlive-mathfield id="mf" ref="mathfield" :config="{smartFence:false}" v-on:focus="ping"
:on-keystroke="displayKeystroke" v-model="formula">f(x)=</mathlive-mathfield>
gives this error
TypeError: Cannot read property '0' of undefined
Environment
Operating System MacOS
Browser Chrome
Issue Analytics
- State:
- Created 3 years ago
- Comments:18 (7 by maintainers)
Top Results From Across the Web
Node modules won't import in my Vue.js project - Stack Overflow
Show activity on this post. I'm trying to import a node module installed through NPM inside a Vue. js single file component. Every...
Read more >Building external modules in VueJS - Pusher Blog
In the sample code above, you can see where the package is imported as PreviewComponent . After it's imported, it's linked to the...
Read more >Packaging Vue Components for npm
By packaging your component to be shared via npm, ... Can't I Just Share .vue Files Directly? ... “Why can't people use my...
Read more >开发工具 - 超级架构师
Delightful Node.js packages and resources https://node.cool ... SwiftQueue - Job Scheduler with Concurrent run, failure/retry, persistence, repeat, ...
Read more >Vue.js - How to Build Your First Package & Publish It on NPM
We'll learn how to make our own plugin for Vue.js, and distribute it on NPM for everyone to use.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hmmm… I think the warning at the top might be relevant: “You are using the runtime-only build of Vue…”. It appears that the element that the Mathfield builds on (
this.element
) is not an HTMLElement but some comment node (!?) Try including the Vue runtime with its compiler.Good catch regarding the documentation. The
options
used to be calledconfig
and the README file had not been updated. Done now.I don’t know what you mean regarding
from a folder that is public
. When setting thefontsDirectory
option it can be either a relative path (which is relative to the location of themathlive.mjs
file) or a fully qualified URL (e.g.http://myserver.com/assets/fonts
) or if you’re executing locally, a local directory, i.e.file://my-drive/my-projects/node_modules/myproject/fonts
.