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

got an assertion error on chan removed 'whatever' #70

Open
slashformotion opened this issue Jan 30, 2022 · 2 comments
Open

got an assertion error on chan removed 'whatever' #70

slashformotion opened this issue Jan 30, 2022 · 2 comments

Comments

@slashformotion
Copy link

Every time i run a chan command (fixed, added, whatever) i get this error:

[chan] [removed] › ✖  error     The `identifier` of the release is required.

here is my CHANGELOG.md

# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.2.0] - 2021-11-03
### Fixed 
- Fixed Two deprecation warnings for _normalize-mixin.scss 

### Changed
- Replaced normalize.scss with a cdn link to normalize.css
## [0.1.2] - 2021-08-21
### Changed
- There is no css files anymore, all the css is generated from scss, except for the hugo-tufte-override.css of course (70c7b91) [#15](https://github.com/slashformotion/hugo-tufte/issues/15)

### Fixed
- An icon wasn't showing in the navbar menu (c8bc5f6) [#26](https://github.com/slashformotion/hugo-tufte/issues/26)

### Deprecated
- Some parts of Feather.js support remained in the code, they are now removed. (472bb3d) [#32](https://github.com/slashformotion/hugo-tufte/issues/32)
## [0.1.1] - 2021-08-15
### Added
- Markdown styling support in the following shortcodes 
    - `marginnote` (4e38a13) [#18](https://github.com/slashformotion/hugo-tufte/issues/18)
    - `blockquote` (628637b) [#20](https://github.com/slashformotion/hugo-tufte/issues/20)
    - `epigraph` (628637b) [#20](https://github.com/slashformotion/hugo-tufte/issues/20)
    - `newthought` (628637b) [#20](https://github.com/slashformotion/hugo-tufte/issues/20)
    - `sidenote` (628637b) [#20](https://github.com/slashformotion/hugo-tufte/issues/20)

### Note
- The link to the repo in the footer is now pointing at https://github.com/slashformotion/hugo-tufte (ccb1ac0) [#22](https://github.com/slashformotion/hugo-tufte/issues/22)
## [0.1.0] - 2021-08-14
### Added
- All of the [Tufte-css](https://github.com/edwardtufte/tufte-css) feature via [shortcodes](https://github.com/slashformotion/hugo-tufte#shortcodes). 
- Support out of the box for social media links( github, gitlab, twitter, patreon, youtube, medium, reddit, stackoverflow, instagram, mastodon, orcid, google_scholar).
- Support for custom navbar and footer links.
- Support for  mathematical typesetting (LaTex) support via [katex](https://katex.org/) or [MathJax](https://www.mathjax.org). 

[Unreleased]: https://github.com/slashformotion/hugo-tufte/compare/v0.2.0...HEAD
[0.1.2]: https://github.com/slashformotion/hugo-tufte/releases/tag/v0.2.0
[0.1.2]: https://github.com/slashformotion/hugo-tufte/releases/tag/v0.1.2
[0.1.1]: https://github.com/slashformotion/hugo-tufte/releases/tag/v0.1.1
[0.1.0]: https://github.com/slashformotion/hugo-tufte/releases/tag/v0.1.0

looks like it comes from here:

assert(identifier, 'The `identifier` of the release is required.')

I tried to understand what is going on but I don't know javascript, so...yeah..i'm stuck on this one

@dpaez
Copy link
Contributor

dpaez commented Apr 27, 2022

Hi @slashformotion sorry for the delay.

Could you run the commands with the --verbose option to see if there is any additional info. Thanks.

@jgraichen
Copy link

I do have the same error message when running chan added text:

> chan added text --verbose
[chan] [added] › ✖  error     AssertionError [ERR_ASSERTION]: The `identifier` of the release is required. 
    at createRelease (file://.../@geut/chan/node_modules/@geut/chast/src/index.js:27:3)
    at file://.../@geut/chan/node_modules/@geut/remark-chan/src/index.js:49:12
    at Array.map (<anonymous>)
    at parseReleases (file://.../@geut/chan/node_modules/@geut/remark-chan/src/index.js:29:26)
    at file://.../@geut/chan/node_modules/@geut/remark-chan/src/index.js:8:50
    at wrapped (.../@geut/chan/node_modules/trough/wrap.js:25:19)
    at next (.../@geut/chan/node_modules/trough/index.js:57:24)
    at Object.run (.../@geut/chan/node_modules/trough/index.js:31:10)
    at executor (.../@geut/chan/node_modules/unified/index.js:292:20)
    at Function.run (.../@geut/chan/node_modules/unified/index.js:289:5)

I did run a bit through the parseHeadingRelease function. My heading is this:

{
  type: 'heading',
  depth: 2,
  children: [ { type: 'text', value: '[1.8.2] - 2021-12-03' } ]
}

This results in link being null, and text ending up as { type: 'text', value: '[1.8.2] - 2021-12-03' }. This means we end up in here:

} else {
const match = text.value.match(/\[(.*?)\]/)
if (match) {
const tag = match[1]
if (tag === 'Unreleased') {
identifier = 'unreleased'
version = tag
unreleased = true
}
if (tag === 'YANKED') {
const [first, rest] = text.value.trim().split(' - ')
const [second] = rest.split(' ')
identifier = first
version = identifier
date = second
yanked = true
}
} else {
// first release: 0.0.1 - 2014-05-31
([version, date] = text.value.trim().split(' - '))
identifier = version
}
}

The pattern does match, but the block only handle Unreleased and yanked tags. 1.8.2 is ignored. This results in identifier, version, date, url all being undefined when returned:

{
  identifier: undefined,
  version: undefined,
  url: undefined,
  date: undefined,
  unreleased: false,
  yanked: false
}

This then triggers the assertion in createRelease.

In my case, two link reference were missing at the bottom (1.8.1 and 1.8.2):

[Unreleased]: .../compare/v1.8.0...HEAD
[1.8.0]: .../compare/v1.7.0...v1.8.0

Adding them fixed the error. The sample above seems to miss the reference for 0.2.0.

I would appreciate it if chan could fix that automatically, if that is possible. It is a really nice tool I use fairly regularly. Thanks a lot!

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

3 participants