Skip to content

Error in copy button #246

@janhesters

Description

@janhesters

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(),
  ],
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions