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

Audio is not defined. #26

Closed
gabrielpgava opened this issue Feb 21, 2024 · 13 comments
Closed

Audio is not defined. #26

gabrielpgava opened this issue Feb 21, 2024 · 13 comments

Comments

@gabrielpgava
Copy link

So, i am trying to run the package on a next JS app, and i get this error, some on know how to fix?

Captura de Tela 2024-02-20 às 22 14 57
@yudielcurbelo
Copy link
Owner

What version are you using?

@gabrielpgava
Copy link
Author

gabrielpgava commented Feb 21, 2024

I am using these versions:
"@yudiel/react-qr-scanner": "^1.2.10",
"next": "^14.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"

@yudielcurbelo
Copy link
Owner

That error is from a previous version. In 1.2.10 it was fixed. Could you check that your .lock file is referencing that version? You could also try to delete your node_modules and recreate it. Please let me know.

@gabrielpgava
Copy link
Author

gabrielpgava commented Feb 21, 2024

The .lock file is referencing version 1.2.10, and I tried to delete the node_modules, but I had no success in solving the issue.

@yudielcurbelo
Copy link
Owner

I have multiple apps deploy to vercel and none of them is presenting this issue with the latest version. I also created a Sandbox and was not able to reproduce it

@gabrielpgava
Copy link
Author

Thanks for your help! I'll keep looking for a solution and let you know when I find it.

@nick-tw
Copy link

nick-tw commented Feb 23, 2024

you probably have SSR on the component. make sure it's rendered on the client

import dynamic from 'next/dynamic'

const DynamicQrScanner = dynamic(() => import('@yudiel/react-qr-scanner').then(mod => mod.QrScanner), {
    ssr: false
  });

<DynamicQrScanner
onDecode={(result) => console.log(result)}
onError={(error) => console.log(error?.message)}
/>

@Aerofolio
Copy link

I was having the same issue and @nick-tw answer solved my problem. Thank you so much.

@yudielcurbelo
Copy link
Owner

This should be fixed in the beta version 2.0.0-beta.2. Please note that there are also many changes in this version. Go over the README.

Copy link

stale bot commented Apr 2, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 2, 2024
@walle233
Copy link

walle233 commented Apr 5, 2024

I have the same problem

version: ^2.0.0-beta.3

@stale stale bot removed the stale label Apr 5, 2024
@NadirBakhsh
Copy link

I am Also facing the same problem.

but I resolved it.

the problem is that Audio URL is underfed on server side. node is server endearment, so it not supported Audio JavaScript API.

Indicational state is false

image

image

image

i hope it will work for everyone

image

@yudielcurbelo
Copy link
Owner

This issue should be fixed on 2.0.0-beta.8. There are breaking changes for this beta release.

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

6 participants