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

Webpack compatibility #27

Open
aleen42 opened this issue Sep 5, 2016 · 7 comments
Open

Webpack compatibility #27

aleen42 opened this issue Sep 5, 2016 · 7 comments

Comments

@aleen42
Copy link

aleen42 commented Sep 5, 2016

The following context of Line 7 will cause a problem in projects, using Webpack, because some syntax errors will be checked out by Webpack. As you will see that, your return is calling outside a function, which is unproper. Soon or later, I'll create a pull request for this issue.

if (!OggDemuxer) return;
aleen42 added a commit to aleen42/flac.js that referenced this issue Sep 5, 2016
@altaywtf
Copy link

altaywtf commented Jan 28, 2017

I'm also suffering because of the same problem :(

I guess it's related with babel. I tried to make it work by enabling allowReturnOutsideFunction flag but it didn't work 😭

  "babel": {
    "parserOpts": {
      "allowReturnOutsideFunction": true
    },
    "presets": [
      "react",
      "es2015",
      "stage-0"
    ],
    "plugins": [
      "react-hot-loader/babel",
      "transform-object-rest-spread"
    ]
  },

Have you find a solution @aleen42?
Also, do you have a suggestion @devongovett?

@aleen42
Copy link
Author

aleen42 commented Jan 29, 2017

I have modified the file ogg.js directly, like the pull request #28 , @altayaydemir .

@nathanosdev
Copy link

Same problem here, please merge the pull request

@aleen42
Copy link
Author

aleen42 commented Apr 14, 2017

It seems like the author has given up maintaining this project.

@crackofdusk
Copy link
Member

When building with make browser, the contents of ogg.js are wrapped in a function and

if (!OggDemuxer) return;

is legal in that context.

It seems that it is possible to use pre-built files with webpack: webpack/webpack#1617 (comment) Is that a bad workaround?

@crackofdusk crackofdusk changed the title A problem of ogg.js Webpack compatibility Apr 14, 2017
@aleen42
Copy link
Author

aleen42 commented Apr 14, 2017

@crackofdusk It's not bad, but I don't think it's a elegant way in JavaScript.

@nathanosdev
Copy link

@aleen42 Thanks for the heads up. It's a pity, aurora.js seemed like a really good prospect for a project. But between this and a number of other issues that I encountered I've had to move on. If it's of any use to anybody else here, I was able to make a simple enough replacement relatively quickly with the Audio Context API.

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

4 participants