NickyMeuleman / nicky-blog

https://nickymeuleman.netlify.app/
GNU General Public License v3.0
14 stars 6 forks source link

different ERROR #95313 #171

Closed NickyMeuleman closed 1 year ago

NickyMeuleman commented 1 year ago

ERROR #95313

Building static HTML failed for path "/blog/multilanguage-codeblocks"

See our docs page for more info on this error: https://gatsby.dev/debug-html

95 | {...defaultProps} 96 | {...props}

97 | code={codeString.trim()} | ^ 98 | // supported languages: https://github.com/FormidableLabs/prism-react-renderer/blob/master/src/vendor/prism/includeLangs.js 99 | language={lang as Language} 100 | theme={undefined}

WebpackError: TypeError: Cannot read properties of undefined (reading 'trim')

Codestring is not available during buildtime, and trim gets called on undefined.

Hint: default it to an empty string in components/MultiLangCode.js

NickyMeuleman commented 1 year ago

the same logic is also used in the Layout component. I suspect the same error happens there too