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

Currently not possible to export or import oggdec.js with ECMAScript Modules #1

Open
guest271314 opened this issue Dec 17, 2019 · 0 comments · May be fixed by guest271314/oggdec-wasm#1

Comments

@guest271314
Copy link

import module from "./oggdec"
const Module = module()
const decodeOggData = Module.decodeOggData
const decodedData = decodeOggData([...some array buffer...])

does not output expected result using the current version f oggdec.js with native ECMAScript Modules (export, import) without an error being thrown.

Using

<script src="oggdec.js"></script>

does not throw an error.

guest271314 added a commit to guest271314/oggdec-wasm that referenced this issue Dec 17, 2019
Fixes jfrancos#1

Substitute globalThis for this at line #26 (un-minified)

var d = "undefined" != typeof window && window === this ? this : "undefined" != typeof global && null != global ? global : globalThis

At line #2887 (un-minified) add export statement

export {Module as decodeOggDecModule};
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

Successfully merging a pull request may close this issue.

1 participant