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

Webcam/Audio not being rendered? #3608

Closed
chiefGui opened this issue Mar 29, 2022 · 1 comment · Fixed by #3692
Closed

Webcam/Audio not being rendered? #3608

chiefGui opened this issue Mar 29, 2022 · 1 comment · Fixed by #3692
Labels

Comments

@chiefGui
Copy link

chiefGui commented Mar 29, 2022

The problem

When trying to use either @uppy/webcam and/or @uppy/audio, the elements related to the plugins are not being rendered.

NOTE: I am reporting as a bug because I followed all the documentation on Uppy's docs webpage and found nothing beyond what I'm doing already. If it's just something that I am missing, would you mind pointing it out?

How to reproduce

  1. Access: https://codesandbox.io/s/serene-tdd-wgn52d?file=/src/App.tsx
  2. Click the Webcam 2 button
  3. Grant the requested permissions

NOTE: This issue occurs with both Webcam and Audio plugins, although the example just displays Webcam. Also, I am not sure if other plugins would be facing the same issue.

Code to reproduce

If for whatever reason CodeSandbox goes down, here's some simple code you can use to reproduce the issue:

import Uppy from "@uppy/core";
import Webcam from "@uppy/webcam";
import { useEffect, useState } from "react";

export default function App() {
  const [uppy, setUppy] = useState(new Uppy({ debug: true }));

  return (
    <div>
      <div id="webcam">
        <h1>Webcam goes here!</h1>
      </div>

      <button
        onClick={() => {
          if (!uppy.getPlugin("Webcam")) {
            uppy.use(Webcam, { target: "#webcam" });
            return;
          }

          uppy.removePlugin(uppy.getPlugin("Webcam")!);
          uppy.use(Webcam, { target: "#webcam" });
        }}
      >
        Webcam 2
      </button>
    </div>
  );
}

Some diagnosis

On some localhost tests I made, I noticed that a console.log here gets rendered successfully. So, perhaps, it's safe to assume that what's happening is because some mysterious transpiler/compiler isn't capable of rendering elements via Preact's h()? I really have no idea.

The environment

  • I could reproduce it with either Next.js (latest version) and CRA (latest version)
  • React 17
  • MacOS
  • Chrome and Edge browsers (latest versions)
  • @uppy/[email protected]
  • @uppy/[email protected]
@chiefGui
Copy link
Author

By merging #3609, the issue seen at the CodeSandbox example will vanish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant