Skip to content

Bug: jsxDEV is not a function #1

@ihopeitdoes

Description

@ihopeitdoes

Using latest sharkord (0.0.7) and latest plugin example

Getting following error

An error occurred in plugin soundboard at slot home_screen.
Please report this to the plugin developer.
Error Details
Copy details
c6.jsxDEV is not a function
TypeError: c6.jsxDEV is not a function
    at h5 

Changing build.ts from

  Bun.build({
    entrypoints: ["src/client.ts"],
    outdir,
    target: "browser",
    minify: true,
    format: "esm",
    plugins: [clientGlobals],
  }),
  Bun.build({
    entrypoints: ["src/client.ts"],
    outdir,
    target: "browser",
    minify: true,
    format: "esm",
    define: {
      "process.env.NODE_ENV": "\"production\"",
    },
    plugins: [clientGlobals],
  }),

Resolves this issue and it works great. I used AI to help fix this so I cant say its the best option. This is what it said:

process.env.NODE_ENV="production" prevents importing react/jsx-dev-runtime, so you get react/jsx-runtime instead of jsxDEV.

Reproduced it using this component soundboard.tsx

import { type TPluginSlotContext } from "@sharkord/plugin-sdk";
import { useState } from "react";

import { Button, Popover, PopoverContent, PopoverTrigger } from "@sharkord/ui";

const Soundboard = ({ currentVoiceChannelId }: TPluginSlotContext) => {
  const [isOpen, setIsOpen] = useState(false);

  return (
    <Popover open={isOpen} onOpenChange={setIsOpen}>
      <PopoverTrigger asChild>
        <Button
          size="icon"
          variant="ghost"
          className="h-8 w-8"
          onClick={() => {
            setIsOpen((prev) => !prev);
          }}
          disabled={!currentVoiceChannelId}
        >
          <span role="img" aria-label="Soundboard">
            🔊
          </span>
        </Button>
      </PopoverTrigger>
      <PopoverContent side="top" align="end" className="w-64">
        <div className="text-sm">Soundboard popup</div>
      </PopoverContent>
    </Popover>
  );
};

export { Soundboard };

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