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

Error with plugin initialization and import: capacitorExports is not defined #92

Open
sethlangel opened this issue Oct 31, 2023 · 7 comments
Labels
question Further information is requested

Comments

@sethlangel
Copy link

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:

  1. 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.

@sethlangel sethlangel changed the title Error with plugin initialization and import: Error with plugin initialization and import: capacitorExports is not defined Oct 31, 2023
@formicagreen
Copy link

Having the same issue

@liho00
Copy link

liho00 commented Dec 24, 2023

same issues with next js build

@bennieforss
Copy link

Same issues with next js build

@hesslau
Copy link

hesslau commented Feb 7, 2024

here as well.
any ideas for a workaround?

@jormaj
Copy link

jormaj commented Apr 24, 2024

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

@JACKZGGG
Copy link

Having the same issue,

@jcesarmobile
Copy link
Contributor

can you provide a sample app? I can't reproduce

@jcesarmobile jcesarmobile added the question Further information is requested label Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

8 participants