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

Error when serializing chords with comments #904

Closed
vjousse opened this issue May 27, 2023 · 4 comments · Fixed by #913
Closed

Error when serializing chords with comments #904

vjousse opened this issue May 27, 2023 · 4 comments · Fixed by #913

Comments

@vjousse
Copy link

vjousse commented May 27, 2023

Hello,

First, thanks for this amazing lib, you saved me a lot of time 😊

I'm trying to serialize a song (containing comments) that ChordSheetJS has parsed successfully, but I am encountering the following error:
Screenshot from 2023-05-27 09-50-51

Here is the code I'm using:

const song = parser.parse(songChordPro);
const serializedSong = new ChordSheetJS.ChordSheetSerializer().serialize(
  song
);

And below the content on the file.

# ----------------------------------------------------------------------------
# ANGIE - The Rolling Stones
# ----------------------------------------------------------------------------
{ns}
{define: E7 base-fret 1 frets 0 2 0 1 0 0} 
{define: F base-fret 1 frets x x 3 2 1 1} 
{t: ANGIE - The Rolling Stones}
{st: (Richards/Jagger)}
{artist: The Rolling Stones}
{composer: Keith Richards; Mick Jagger}

https://www.youtube.com/watch?v=K5_EBAzIPJM  (Capo 0)
 

[INTRO:]   [Am][,]     [E]     [E][-][E7][,]     [G]     [F][;]       [F]     [C][,]     [G]     [Am]

Angie, [E]An [E7]gie, [G]when will those clouds [F]all disappear-[C]er?  
[Am]Angie, [E]An [E7]gie, [G]where will it lead [F]us from here-[C]ere?
With no [G]loving in our souls, and no [Dm]money in our [Am]coats, 
[C]You can't [F]say we're satis[G]fied.
But [Am]Angie, [E]An [E7]gie, [G]you can't [F]say we never tri-[C]ed?

[Am]Angie, you're [E]beauti[E7]ful, yeah.  
[G]But ain't it time we [F]said goodby-[C]eye?
[Am]Angie, I still [E]love [E7]you, 
[G]Remember all those [F]nights we cri-[C]ied? 

All the [G]dreams we held so close, seemed to [Dm]all go up in [Am]smoke.  
[C]Let me [F]whisper in your [G]ear:  
"[Am]Angie, [E]Angie, [G]where will it [F]lead us, from here-[C]ere?"

[Am] [E]     [E7][,]     [G]     [F]     [Dm]       [C][;]       [Am]       [E]     [E7][,]     [G]     [F]     [Dm]       [C]

Ohhh [G]Angie don't you weep, all your [Dm]kisses still taste [Am]sweet.  
[C]I hate that [F]sadness in your [G]eyes. 
But [Am]Angie, [E]An [E7]gie, [G]ain't it [F]time we said goodby-[C]eye?

[Am] [E]     [E7][,]     [G]     [F]     [Dm]       [C]

With no [G]loving, in our souls, and no [Dm]money in our [Am]coats, 
[C]You can't [F]say were satis[G]fied.
But [Dm]Angie, I still love you [Am]baby.  [Dm]Everywhere I look, I see your [Am]eyes.
[Dm]There ain't a woman that comes [Am]close to you.  [C]Come on [F]baby dry your [G]eyes.

[Am]Angie, [E]An [E7]gie, [G]ain't it [F]good to be ali-[C]ive? 
 
[Am]Angie, [E]An [E7]gie, [G]they can't [F]say we never tri-[C]ied. 


If I remove the comments

# ----------------------------------------------------------------------------
# ANGIE - The Rolling Stones
# ----------------------------------------------------------------------------

Everything works as expected.

@martijnversluis
Copy link
Owner

@vjousse Thanks for reporting this issue 👍. I just published v7.17.1 that addresses this bug.

Please let me know if this fixes your issue.

@vjousse
Copy link
Author

vjousse commented Jul 11, 2023

Hello @martijnversluis ,
Thanks for the fix! Unfortunately, I'm still facing the same issue. Are you sure the v7.17.1 was correctly published? It seems that it doesn't contain your fix.

Here is the version I am using from my yarn.lock file:

chordsheetjs@^7.17.1:
  version "7.17.1"
  resolved "https://registry.yarnpkg.com/chordsheetjs/-/chordsheetjs-7.17.1.tgz#7defe9feea0b5b1115d996bed6a1b7a4a8a28f60"
  integrity sha512-K8sBgYNonbaUHs8x7PYhDmkOrg4QS4nr456s8M7KrpBL8iqyzYU0ZZvoANOeAGXdbh95XDEHVs+0BLjxXAT2zA==
  dependencies:
    lodash.get "^4.4.2"

For example, there is no mention of your new formatComment function in the downloaded .tgz. Am I missing something?

Here is my package.json:

{
  "scripts": {
    "start": "parcel html/index.html",
    "build": "parcel build html/index.html"
  },
  "devDependencies": {
    "@parcel/transformer-elm": "2.9.3",
    "elm": "^0.19.1-5",
    "parcel": "^2.9.3",
    "postcss": "^8.4.14",
    "process": "^0.11.10",
    "tailwindcss": "^3.0.24"
  },
  "dependencies": {
    "chordsheetjs": "^7.17.1"
  }
}

@martijnversluis
Copy link
Owner

Hey @vjousse. You're completely right, for some reason this change did not end up in the release.

I published 7.17.2 and tested it using RunKit, so now I know for sure the change is included.

Please let me know if it is fixed now 😄

@vjousse
Copy link
Author

vjousse commented Jul 15, 2023

Thanks a lot, it works now! 😊

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

Successfully merging a pull request may close this issue.

2 participants