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

Parser Causes Exception #28

Closed
thatsddr opened this issue Sep 22, 2023 · 5 comments · Fixed by #29
Closed

Parser Causes Exception #28

thatsddr opened this issue Sep 22, 2023 · 5 comments · Fixed by #29

Comments

@thatsddr
Copy link

Hello everyone!

I am not sure if I am the only one to experience this, but since version 2.9.1 the release fails with the following error:

TypeError: this.buffer.substring is not a function
    at Lexer.getLine (/home/runner/work/ott-channel-schedule-template/ott-channel-schedule-template/node_modules/yaml/dist/parse/lexer.js:208:28)
    at Lexer.parseStream (/home/runner/work/ott-channel-schedule-template/ott-channel-schedule-template/node_modules/yaml/dist/parse/lexer.js:244:25)
    at parseStream.next (<anonymous>)
    at Lexer.parseNext (/home/runner/work/ott-channel-schedule-template/ott-channel-schedule-template/node_modules/yaml/dist/parse/lexer.js:226:36)
    at parseNext.next (<anonymous>)
    at Lexer.lex (/home/runner/work/ott-channel-schedule-template/ott-channel-schedule-template/node_modules/yaml/dist/parse/lexer.js:160:32)
    at lex.next (<anonymous>)
    at Parser.parse (/home/runner/work/ott-channel-schedule-template/ott-channel-schedule-template/node_modules/yaml/dist/parse/parser.js:159:20)
    at parse.next (<anonymous>)
    at Composer.compose (/home/runner/work/ott-channel-schedule-template/ott-channel-schedule-template/node_modules/yaml/dist/compose/composer.js:130:20) {
  pluginName: 'semantic-release-helm3'
}

I tried with node versions 18, 19, and 20.
I did some investigation and I think the problem might be in `lib/publish.js' on lines 23- 24:

const chartYaml = await fsPromises.readFile(filePath);
const chart = yaml.parse(chartYaml);

I found this issue on GitHub that hints at the fact that readFile returns a buffer if called without a second argument, while yaml.parse() expects a string.

I would be curious to hear someone else's opinion on this and knowing if anyone else had this issue

@nflaig
Copy link
Owner

nflaig commented Sep 22, 2023

I think you are correct, opened a PR to fix that. Would you be able to test the fix? I can release a rc

@nflaig
Copy link
Owner

nflaig commented Sep 22, 2023

Published [email protected] with a fix

@thatsddr
Copy link
Author

The project is for my organization, so I can't trigger a new release if I don't have new features, but as soon as I or one of my colleagues release something either in this or another project, we will try the version with the fix

@nflaig
Copy link
Owner

nflaig commented Sep 22, 2023

I think I will just release this before others run into the same issue. Thanks a lot for reporting and sorry that this caused issues.

@nflaig
Copy link
Owner

nflaig commented Sep 22, 2023

Published a new version [email protected]

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