Giter Club home page Giter Club logo

Comments (9)

s-h-a-d-o-w avatar s-h-a-d-o-w commented on August 21, 2024 9

Hm, maybe you coincidentally already had things set up in a way that it wasn't a problem?

Personally, I had to use this (for future reference in case someone else stumbles across this):

  module: {
    noParse: /ffmpeg/,
    rules: [{
      test: /\.(js|jsx)$/,
      exclude: [/node_modules/, /ffmpeg/],
      use: [
        'babel-loader',
      ],
    },
  ...

... so that bundling worked. (Without it, webpack's node process would quickly balloon into using gigs of RAM)
Oh yeah - I don't have ffmpeg in my node_modules because... I tried to get Webstorm not to crash because of trying to index the file. So I copied it out of there and excluded only my ffmpeg directory in Webstorm's project window. Which... I thought would keep it from indexing and thus crashing - didn't work. Using VS Code now.

And in my dev environment config this...

new webpack.EvalSourceMapDevToolPlugin({
      exclude: /ffmpeg/
    })

... to prevent the file from ballooning up to ~35 MB.

from ffmpeg.js.

Shrekie avatar Shrekie commented on August 21, 2024 1

@s-h-a-d-o-w You are amazing thanks

from ffmpeg.js.

JHartman5 avatar JHartman5 commented on August 21, 2024

I passed --max-old-space-size=8192 to get it to build. I have other problems now, ;-) but this helped me get past this particular issue.

from ffmpeg.js.

franklin-huang avatar franklin-huang commented on August 21, 2024

@JHartman5 Thanks for your help.
We decided not to encode the raw data from webcam. Instead we are using MediaStream Recording API to have webm segments, which small enough to send back to the server.

from ffmpeg.js.

s-h-a-d-o-w avatar s-h-a-d-o-w commented on August 21, 2024

@JHartman5
But doesn't that take forever to build? I waited for like 2 minutes and when it was still not done, I killed the process...
It's not really a great dev workflow when after each change, you have to wait minutes for the build process to finish?

from ffmpeg.js.

JHartman5 avatar JHartman5 commented on August 21, 2024

No, it worked in the normal time for me.

from ffmpeg.js.

JerryCjr avatar JerryCjr commented on August 21, 2024
// webpack.config.js
const path = require('path');

module.exports = {
  entry: './src/index.js',
  output: {
    filename: 'bundle.js',
    path: path.resolve(__dirname, 'dist')
  },
  module: {
    noParse: /ffmpeg/,
    rules: [{
      test: /\.(js|jsx)$/,
      exclude: [/node_modules/, /ffmpeg/],
      use: [
        'babel-loader',
      ],
    }]
  }
};

This is my configuration of webpack. And this error occurs when build.

ERROR in bundle.js from Terser
Import statement may only appear at top level [bundle.js:91,0]
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: `webpack`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/chengjinrui/.npm/_logs/2019-08-02T12_00_30_302Z-debug.log

from ffmpeg.js.

JerryCjr avatar JerryCjr commented on August 21, 2024

@s-h-a-d-o-w

from ffmpeg.js.

florian-milky avatar florian-milky commented on August 21, 2024

It's important to exclude it from the minification if you have that otherwise your build time will skyrocket

from ffmpeg.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.