native-audio
native-audio copied to clipboard
Error with plugin initialization and import: capacitorExports is not defined
Describe the bug A clear and concise description of what the bug is.
Initialization of plugin and importing NativeAudio throws an error
ReferenceError: capacitorExports is not defined
To Reproduce Steps to reproduce the behavior:
- Import NativeAudio as described in the docs??
Expected behavior Plugin and methods get imported, methods able to be used to load the audio.
-Web, iOS, and Android
Additional context I removed the NativeAudio.preload code and it still crashed. I removed the import and the error went away. Using NextJS 12.
Having the same issue
same issues with next js build
Same issues with next js build
here as well. any ideas for a workaround?
In my case this was caused by an issue with the ESM module version. If you explicitly load the commonJS version, it seems to be working fine. You can do this in the following way:
import { NativeAudio } from '@capgo/native-audio/dist/plugin.cjs';
Note that I'm using the Capgo fork, but might work with the capacitor-community version as well
Having the same issue,
can you provide a sample app? I can't reproduce