Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in copy button #246

Open
janhesters opened this issue Oct 1, 2024 · 0 comments
Open

Error in copy button #246

janhesters opened this issue Oct 1, 2024 · 0 comments

Comments

@janhesters
Copy link

janhesters commented Oct 1, 2024

Here is the error:

chunk-GZD7INZN.js?v=2102d38d:3624 Uncaught Error: Expected `onClick` listener to be a function, instead got a value of `string` type.
    at getListener (chunk-GZD7INZN.js?v=2102d38d:3624:19)
    at accumulateSinglePhaseListeners (chunk-GZD7INZN.js?v=2102d38d:7195:32)
    at extractEvents$4 (chunk-GZD7INZN.js?v=2102d38d:6984:30)
    at extractEvents$5 (chunk-GZD7INZN.js?v=2102d38d:7000:11)
    at dispatchEventsForPlugins (chunk-GZD7INZN.js?v=2102d38d:7050:11)
    at chunk-GZD7INZN.js?v=2102d38d:7174:20
    at batchedUpdates$1 (chunk-GZD7INZN.js?v=2102d38d:18913:20)
    at batchedUpdates (chunk-GZD7INZN.js?v=2102d38d:3579:20)
    at dispatchEventForPluginEventSystem (chunk-GZD7INZN.js?v=2102d38d:7173:11)
    at dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay (chunk-GZD7INZN.js?v=2102d38d:5478:13)

Configuration:

import mdx from '@mdx-js/rollup';
import { transformerCopyButton } from '@rehype-pretty/transformers';
import { vitePlugin as remix } from '@remix-run/dev';
import type { Options } from 'rehype-pretty-code';
import { rehypePrettyCode } from 'rehype-pretty-code';
import remarkFrontmatter from 'remark-frontmatter';
import remarkGfm from 'remark-gfm';
import remarkMdxFrontmatter from 'remark-mdx-frontmatter';
import { defineConfig } from 'vite';
import tsconfigPaths from 'vite-tsconfig-paths';

const options: Options = {
  theme: 'night-owl',
  transformers: [transformerCopyButton()],
};

export default defineConfig({
  plugins: [
    mdx({
      remarkPlugins: [remarkFrontmatter, remarkGfm, remarkMdxFrontmatter],
      rehypePlugins: [[rehypePrettyCode, options]],
    }),
    remix({
      future: {
        v3_fetcherPersist: true,
        v3_relativeSplatPath: true,
        v3_throwAbortReason: true,
        unstable_singleFetch: true,
        unstable_lazyRouteDiscovery: true,
        unstable_optimizeDeps: true,
      },
    }),
    tsconfigPaths(),
  ],
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant