Could not find a declaration file for module 'vextab'.

56 views
Skip to first unread message

Stefano Corradi

unread,
Feb 19, 2023, 5:50:32 AM2/19/23
to vexflow
Hi,
in VueJs 3

after

npm install vextab

and then in my component

import {VexTab, Artist, Vex} from 'vextab';

I've this error in console

Uncaught SyntaxError: ambiguous indirect export: default

What can I do to import the modules correctly?
thanks!


Luis Badolato

unread,
Oct 13, 2024, 11:57:57 AM10/13/24
to vexflow
Any luck with it?

I've been trying for a while to use VexTab on either a Lit project or a React project and in both cases I'm having the same issues.

Thanks in advance!

Dan Whitehouse

unread,
Oct 15, 2024, 12:14:01 PM10/15/24
to vexflow
I too am having the same/similar issue. 

import { VexTab, Artist, Vex } from 'vextab';
Uncaught (in promise) SyntaxError: The requested module '/node_modules/.vite/deps/vextab.js?t=1729007950048&v=e0cf03e8' does not provide an export named 'default'

If I do this: (adding the ts type key word)
import type { VexTab, Artist, Vex } from 'vextab';
Uncaught (in promise) ReferenceError: Vex is not defined

I tried including vexflow itself, which does not produce any issues right away.
import { Flow } from 'vexflow';
import type { VexTab, Artist } from 'vextab';
const Renderer = Flow.Renderer;

try {
const element: HTMLElement = document.getElementById(id) as HTMLElement;
//const renderer = new Renderer(element, Renderer.Backends.SVG);
const renderer = new Renderer(element, Renderer.Backends.SVG);

// Initialize VexTab artist and parser.
const artist = new Artist(10, 10, 600, { scale: 0.8 });
console.log('artist', artist)
const tab = new VexTab(artist);

  try {
    tab.parse(data);
    artist.render(renderer);
  }
  catch (e) {
    console.error(e);
  }
}
catch(e) {
   console.log(e)
}
but when I call my function to generate the svg I get:
ReferenceError: Artist is not defined


Any help would be appreciated. 


Reply all
Reply to author
Forward
0 new messages