# Node-red-contrib-static-markdown is reporting TypeError: Cannot read property 'attrJoin' of undefined

**URL:** https://discourse.nodered.org/t/node-red-contrib-static-markdown-is-reporting-typeerror-cannot-read-property-attrjoin-of-undefined/32081
**Category:** General
**Created:** [27 August 2020 07:36 UTC](https://discourse.nodered.org/t/node-red-contrib-static-markdown-is-reporting-typeerror-cannot-read-property-attrjoin-of-undefined/32081 "2020-08-27T07:36:28Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)
#### Post date: [27 August 2020 07:36 UTC](https://discourse.nodered.org/t/node-red-contrib-static-markdown-is-reporting-typeerror-cannot-read-property-attrjoin-of-undefined/32081/1 "2020-08-27T07:36:28Z")

</div>

`node-red-contrib-static-markdown` seems to provide the exact functionality I need but I am facing a little issue:

I have cloned the github repository:

- [https://github.com/TotallyInformation/node-red-contrib-static-markdown](https://github.com/TotallyInformation/node-red-contrib-static-markdown)

so that I can test that the markdown in the example folder `docs/test-md-library` is properly rendered.

This seems to be the case for the [index.md](https://github.com/TotallyInformation/node-red-contrib-static-markdown/blob/master/docs/test-md-library/index.md) but not for the [test.md](https://github.com/TotallyInformation/node-red-contrib-static-markdown/blob/master/docs/test-md-library/test.md) in same folder.

So this is what I get when navigating to test.md:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/8/282f6217968873178a01d8dee4e61e1f721eed01.png)

same error copy pasted as text:

```auto
TypeError: Cannot read property 'attrJoin' of undefined
    at Object.exports.addAttrs (/data/node_modules/@gerhobbelt/markdown-it-attrs/utils.js:105:13)
    at Object.transform (/data/node_modules/@gerhobbelt/markdown-it-attrs/patterns.js:131:15)
    at Array.curlyAttrs (/data/node_modules/@gerhobbelt/markdown-it-attrs/index.js:30:19)
    at Core.process (/data/node_modules/markdown-it/lib/parser_core.js:51:13)
    at MarkdownIt.parse (/data/node_modules/markdown-it/lib/index.js:523:13)
    at MarkdownIt.render (/data/node_modules/markdown-it/lib/index.js:543:36)
    at /data/node_modules/node-red-contrib-static-markdown/nodes/lib/serveMarkdown.js:213:39
    at /data/node_modules/graceful-fs/graceful-fs.js:123:16
    at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)

```

Note that it seems to be working fine for [index.md](https://github.com/TotallyInformation/node-red-contrib-static-markdown/blob/master/docs/test-md-library/index.md). So when navigating to [http://127.0.0.1:1880/md](http://127.0.0.1:1880/md) or [http://127.0.0.1:1880/md/index.md](http://127.0.0.1:1880/md/index.md) : I am seeing the following page:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/5/55080b98f3d8a138d991b5f4638821b11a04bf16.png)

---

<div class="post-metadata">

### Author: ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)
#### Post date: [27 August 2020 08:11 UTC](https://discourse.nodered.org/t/node-red-contrib-static-markdown-is-reporting-typeerror-cannot-read-property-attrjoin-of-undefined/32081/2 "2020-08-27T08:11:27Z")

</div>

I think it is a markdown library compatibiity issue that is described in

- [https://github.com/arve0/markdown-it-attrs/issues/90](https://github.com/arve0/markdown-it-attrs/issues/90)

as I am getting the same error for my file `test2.md` with following content:

```auto
This is a paragraph of text with a *highlighted*{.hi} word in it.

```

It gives error

```auto
TypeError: Cannot read property 'attrJoin' of undefined
    at Object.exports.addAttrs (/data/node_modules/@gerhobbelt/markdown-it-attrs/utils.js:105:13)
    at Object.transform (/data/node_modules/@gerhobbelt/markdown-it-attrs/patterns.js:131:15)
    at Array.curlyAttrs (/data/node_modules/@gerhobbelt/markdown-it-attrs/index.js:30:19)
    at Core.process (/data/node_modules/markdown-it/lib/parser_core.js:51:13)
    at MarkdownIt.parse (/data/node_modules/markdown-it/lib/index.js:523:13)
    at MarkdownIt.render (/data/node_modules/markdown-it/lib/index.js:543:36)
    at /data/node_modules/node-red-contrib-static-markdown/nodes/lib/serveMarkdown.js:213:39
    at /data/node_modules/graceful-fs/graceful-fs.js:123:16
    at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)

```

---

<div class="post-metadata">

### Author: ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)
#### Post date: [27 August 2020 08:12 UTC](https://discourse.nodered.org/t/node-red-contrib-static-markdown-is-reporting-typeerror-cannot-read-property-attrjoin-of-undefined/32081/3 "2020-08-27T08:12:33Z")

</div>

I guess/hope this also means that the bulk of the markdown will work and that there is only an issue when using special markdown.

---

<div class="post-metadata">

### Author: ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)
#### Post date: [30 August 2020 08:51 UTC](https://discourse.nodered.org/t/node-red-contrib-static-markdown-is-reporting-typeerror-cannot-read-property-attrjoin-of-undefined/32081/4 "2020-08-30T08:51:11Z")

</div>

I have also reported this issue in the github repository

- [https://github.com/TotallyInformation/node-red-contrib-static-markdown/issues/7](https://github.com/TotallyInformation/node-red-contrib-static-markdown/issues/7)

... but sofar it is not blocking anything for me. The excellent node provides exactly what I need !

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [29 October 2020 08:51 UTC](https://discourse.nodered.org/t/node-red-contrib-static-markdown-is-reporting-typeerror-cannot-read-property-attrjoin-of-undefined/32081/5 "2020-10-29T08:51:23Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
