Rollup: Uncaught ReferenceError: require is not defined

Created on 27 Jan 2016  ·  3Comments  ·  Source: rollup/rollup

Hi. I keep getting this error, despite bundling using cjs format. My rollup config file looks like this:

import babel from 'rollup-plugin-babel';

export default {
  entry: 'client/src/app.js',
  dest: 'dist/bundle.js',
  plugins: [ babel() ],
  format: 'cjs'
};

and I'm bundling by running rollup -c in root directory. I've also set my .babelrc file to have the es2015-rollup preset. But for some reason, i keep getting this error and can't figure out what's going on.

Any help would be really appreciated.

c⁴ ⋅ need more info

Most helpful comment

@iam-peekay but how did you end up resolving this?

All 3 comments

Can you provide more detail? Do you get the error when running rollup? Or when running the generated code? Is there a stack trace? Can you share the contents of app.js?

/cc @iam-peekay

@iam-peekay but how did you end up resolving this?

Was this page helpful?
0 / 5 - 0 ratings