astrohost Documents/my-site (main ⚡) Hyperion
[MDX] Now inheriting remark and rehype plugins from "markdown" config.
If you applied a plugin to both your Markdown and MDX configs, we suggest removing the duplicate MDX entry.
See "extendPlugins" option to configure this behavior.
error hl.setColorReplacements is not a function
TypeError: hl.setColorReplacements is not a function
at file:///Users/cain/Documents/my-site/node_modules/@astrojs/mdx/dist/remark-shiki.js:9:10
at async remarkShiki (file:///Users/cain/Documents/my-site/node_modules/@astrojs/mdx/dist/remark-shiki.js:26:23)
at async getRemarkPlugins (file:///Users/cain/Documents/my-site/node_modules/@astrojs/mdx/dist/utils.js:92:25)
at async Object.astro:config:setup (file:///Users/cain/Documents/my-site/node_modules/@astrojs/mdx/dist/index.js:38:26)
at async withTakingALongTimeMsg (file:///usr/local/lib/node_modules/astro/dist/integrations/index.js:13:18)
at async runHookConfigSetup (file:///usr/local/lib/node_modules/astro/dist/integrations/index.js:62:7)
at async dev (file:///usr/local/lib/node_modules/astro/dist/core/dev/index.js:19:14)
at async startDevServer (file:///usr/local/lib/node_modules/astro/dist/cli/index.js:144:35)
at async runCommand (file:///usr/local/lib/node_modules/astro/dist/cli/index.js:185:7)
at async cli (file:///usr/local/lib/node_modules/astro/dist/cli/index.js:207:5)
#Error on `astro dev --host`
1 messages · Page 1 of 1 (latest)
I have seen people mention needing an empty flag — you could try doing ‘astro dev — —host’
no dice :(
Are you duplicating plugin definitions in your config?
i dont think, no
<@&882699029706862602> i still need help here unfortunately
import { defineConfig } from 'astro/config';
import { remarkReadingTime } from '/src/lib/remark-reading-time.mjs';
import tailwind from '@astrojs/tailwind';
import sitemap from '@astrojs/sitemap';
import mdx from "@astrojs/mdx";
// import remarkGFM from "remark-gfm";
// import remarkSmartypants from "remark-smartypants";
// https://astro.build/config
export default defineConfig({
markdown: {
remarkPlugins: [remarkReadingTime],
extendDefaultPlugins: true,
syntaxHighlight: 'shiki',
shikiConfig: {
theme: 'github-dark',
langs: [],
wrap: true,
},
},
site: 'http://localhost:3000/',
integrations: [sitemap(), tailwind(), mdx()]
this is my config file
You could try removing the import for smartypants and gfm, astro adds those plugins by default
do i import them?
the ones for smartypants and gfm i commented out, and used extenddefault instead
My bad I didn’t see the comments and thought it was double importing or something, instead you could try moving everything from your markdown settings to your mdx settings like this example https://docs.astro.build/en/guides/integrations-guide/mdx/#astrodefaults
Hm, you shouldn't need an extend magic to get this working. Are you still getting this issue without custom plugins? aka
import { defineConfig } from 'astro/config';
import { remarkReadingTime } from '/src/lib/remark-reading-time.mjs';
import tailwind from '@astrojs/tailwind';
import sitemap from '@astrojs/sitemap';
import mdx from "@astrojs/mdx";
// https://astro.build/config
export default defineConfig({
markdown: {
syntaxHighlight: 'shiki',
shikiConfig: {
theme: 'github-dark',
langs: [],
wrap: true,
},
},
site: 'http://localhost:3000/',
integrations: [sitemap(), tailwind(), mdx()]
Another thing to try: remove your shikiConfig
(just narrowing down the problem. Either one is a bug)
Gotcha. I'll try this out