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

use vextab in angular-cli #106

Open
lilworks opened this issue Oct 25, 2018 · 12 comments
Open

use vextab in angular-cli #106

lilworks opened this issue Oct 25, 2018 · 12 comments

Comments

@lilworks
Copy link

lilworks commented Oct 25, 2018

I'm trying to get the vextab api in an angular-cli project. I manage to get Vexflow working but I can't get
import * as vextab from 'vextab'

here a stackblitz
(https://stackblitz.com/edit/angular-umnmcs)

Any suggestion?

@stephaneeybert
Copy link

@lilworks You got some progress ?

@davidmold
Copy link

Yes, this won't work in VueJS either. If you try to import vextab with
import {VexTab, Artist, Vex} from 'vextab';
or
import vextab from 'vextab'

all of the imports are undefined.

@leocaseiro
Copy link

After releasing a compiled UMD #113 to npm, this issue should be fixed.

@LeonhWolf
Copy link

But does it work now? #113 seems to have been merged but I still get the same error when trying to import vextab in Vue.js.

@leocaseiro
Copy link

leocaseiro commented Jul 11, 2021

I think the version has not been published to npm yet.

@LeonhWolf
Copy link

Hi, it's been a while and I wanted to give it another shot. @leocaseiro were you able to use vextab by installing it directly from this repo and not from npm?
I tried npm i https://github.com/0xfe/vextab.git and it installed everything. However, I keep getting the error Module not found: Error: Can't resolve 'vextab' in 'C:\path\to\component'.
I tried deleting the folder node_modules and npm install. Didn't work either.

Could you give me a little nudge into the right direction?

@pmarsceill
Copy link

pmarsceill commented Mar 21, 2022

Has there been any update here? Really looking forward to using VexTab with a react project I'm working on. @leocaseiro were you able to get this to work?

@stephaneeybert
Copy link

@pmarsceill Here is how I did to import it.

import Vex from 'vexflow';

My package.json file contains:

"vexflow": "^3.0.9",
"@types/vexflow": "^1.2.33",

I could then use it like:

const formatter: Vex.Flow.Formatter = new Vex.Flow.Formatter();
const stave: Vex.Flow.Stave = this.drawBareStave(measure, soundtrack, displayWidth, staveX, staveY);

@pmarsceill
Copy link

I got that working for VexFlow as you described @stephaneeybert , but to use the VexTab syntax there is no way to import the vextab package.

@pmarsceill
Copy link

For those curious, I got the import to work in my React app by cloning this repo, running the build script locally, and then copying the entire repo/directory into a vendor folder in my project. Then importing the build output (/dist) from the local copy (instead importing the module from npm):

import { Vex, Artist, VexTab } from '../../../vendor/vextab/dist/main.prod'

Not ideal, but it works for now.

@K20shores
Copy link

I've tried what @pmarsceill suggested in vue 3.3.11 with vite. I've gotten close

I ran

npm update
npm install
export NODE_OPTIONS=--openssl-legacy-provider
npm run build

then I copied the dist folderd and imported like this

import { VexTab, Artist, Vex } from "../../vendor/vextab/dist/main.prod"

but I still receive an import error.

Uncaught SyntaxError: The requested module '/vendor/vextab/dist/main.prod.js' does not provide an export named 'Artist' (at Component.vue:18:18)

I'll continue trying to figure this out, but @0xfe, is there any chance we could get something published that defines these exports?

@K20shores K20shores mentioned this issue Jan 26, 2024
4 tasks
@dan-whitehouse
Copy link

This isn't fixed, can we please look into this?

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

8 participants