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: 'default' is not exported by node_modules/rollup-plugin-node-polyfills/polyfills/buffer-es6.js, imported by node_modules/rollup-plugin-node-polyfills/polyfills/crypto-browserify.js #20

Open
brandonros opened this issue Dec 12, 2020 · 5 comments · May be fixed by #21

Comments

@brandonros
Copy link

index.js:

import { createCipheriv, createDecipheriv, pbkdf2Sync } from 'crypto'

rollup.config.js:

import nodePolyfills from 'rollup-plugin-node-polyfills';

export default {
  input: 'src/index.js',
  output: {
    dir: 'dist',
    format: 'iife'
  },
  plugins: [
    nodePolyfills({
      buffer: true,
      crypto: true
    })
  ]
}

@NoneOfMaster
Copy link

I reproduce this error as well.

Noticed that the tests make mention of the crypto module being broken.

@Kalmanto
Copy link

@brandonros @NoneOfMaster
open crypto-browserify.js and change "import buffer$1 from 'buffer';" to "import * as buffer$1 from 'buffer';"

habdelra added a commit to habdelra/rollup-plugin-node-polyfills that referenced this issue Feb 2, 2021
@habdelra habdelra linked a pull request Feb 2, 2021 that will close this issue
AshleySetter added a commit to AshleySetter/rollup-plugin-node-polyfills that referenced this issue Apr 26, 2021
@AshleySetter
Copy link

This problem still seems to be present

@steampoweredtaco
Copy link

fix #21 Isn't all that is needed to fix the build issues with crypto. I found you also need a default export in pollyfills/string-decoder.js

@ticklemycode
Copy link

This issue still happening, can we get a fixed merged in?

[ ERROR ]  Rollup: Missing Export: ../../node_modules/rollup-plugin-node-polyfills/polyfills/crypto-browserify.js:1:7
           'default' is not exported by ../../node_modules/rollup-plugin-node-polyfills/polyfills/buffer-es6.js,
           imported by ../../node_modules/rollup-plugin-node-polyfills/polyfills/crypto-browserify.js

      L1:  import buffer$1 from 'buffer';
      L2:  import stream from 'stream';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants