Hello,
I am trying to use markdown-it in my application. It works fine on Nuxt and other serverless platforms like Vercel, but it does not work on Cloudflare Workers for some reason.
Here is my code:
<template>
<div v-html="parsed">
</div>
</template>
<script setup>
import { ref } from 'vue'
import MarkdownIt from 'markdown-it'
const md = new MarkdownIt('default', {
html: true,
linkify: true,
breaks: false
})
const markdown = 'https://modrinth.com'
const parsed = ref(md.render(markdown))
</script>
Here is a minimum repro example I have made: https://github.com/Geometrically/repro-nuxt-markdown. Let me know what I can do to fix this.
The full error and calltrace is:
TypeError: Cannot convert object to primitive value
at Yc.format (core:user:repro-nuxi-markdown:19126:164)
at MarkdownIt$1.normalizeLink (core:user:repro-nuxi-markdown:20480:27)
at Array.Up (core:user:repro-nuxi-markdown:20146:377)
at ParserInline$1.tokenize (core:user:repro-nuxi-markdown:20315:48)
at ParserInline$1.parse (core:user:repro-nuxi-markdown:20326:17)
at Array.Kl (core:user:repro-nuxi-markdown:19540:57)
at Core.process (core:user:repro-nuxi-markdown:19586:15)
at MarkdownIt$1.parse (core:user:repro-nuxi-markdown:20536:24)
at MarkdownIt$1.render (core:user:repro-nuxi-markdown:20538:55)
at setup (core:user:repro-nuxi-markdown:20795:23) {
stack: TypeError: Cannot convert object to primitive valu…at setup (core:user:repro-nuxi-markdown:20795:23),
message: Cannot convert object to primitive value
}