tuchk4 / storybook-readme

React Storybook addon to render README files in github style

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nodeEmoji.default.get is not a function

morewry opened this issue · comments

With @storybook/html@5.3.8, storybook-readme@5.08, and node-emoji@1.10.0, I get these errors:

index.js:47 TypeError: _nodeEmoji.default.get is not a function
    at transformEmojis.js:31
    at Array.forEach (<anonymous>)
    at transformEmojis (transformEmojis.js:30)
    at processMd (getDocsLayout.js:79)
    at Array.map (<anonymous>)
    at getDocsLayout (getDocsLayout.js:91)
    at wrapper (index.js:26)
    at make-decorator.js:37
    at make-decorator.js:51
    at hooks.js:241
_nodeEmoji.default.get is not a function
TypeError: _nodeEmoji.default.get is not a function
    at http://localhost:5364/vendors~main.f1f31ec39acdcf0a2be1.bundle.js:99533:67
    at Array.forEach (<anonymous>)
    at transformEmojis (http://localhost:5364/vendors~main.f1f31ec39acdcf0a2be1.bundle.js:99532:26)
    at processMd (http://localhost:5364/vendors~main.f1f31ec39acdcf0a2be1.bundle.js:98928:60)
    at Array.map (<anonymous>)
    at getDocsLayout (http://localhost:5364/vendors~main.f1f31ec39acdcf0a2be1.bundle.js:98940:32)
    at wrapper (http://localhost:5364/vendors~main.f1f31ec39acdcf0a2be1.bundle.js:98751:85)
    at http://localhost:5364/vendors~main.f1f31ec39acdcf0a2be1.bundle.js:20444:14
    at http://localhost:5364/vendors~main.f1f31ec39acdcf0a2be1.bundle.js:20458:26
    at http://localhost:5364/vendors~main.f1f31ec39acdcf0a2be1.bundle.js:19968:21

Some debugging shows that require('node-emoji') imports a map of all the emoji, but none of the methods demonstrated in the node-emoji readme like get or search.

The issue is that node-emoji's entry point index.js requires lib/emoji (no file extension). That directory contains both emoji.js and emoji.json.

Our custom webpack configuration had put json before js in resolve.extensions. Re-ordering so json is after js fixes the problem.