Open maxwell8888 opened 4 years ago
Have you trieed passsing 'preferBuiltins: true' to disable the warning?
I'm bundling for the browser, so don't want to include stream. Adding preferBuiltins: false
option to @rollup/plugin-node-resolve
, still fails with Error: Could not load stream (imported by node_modules/papaparse/papaparse.js): ENOENT: no such file or directory, open 'stream'
.
Line 913 is causing the problem: var Duplex = require('stream').Duplex;
.
Updating to var Duplex = false ? require("stream").Duplex : true;
, where false should be a check for whether the platform is a web browser, solves the problem in my local version and allows rollup to bundle without adding the rogue import stream from "stream";
. I tried adding var Duplex = global !== "browser" ? require("stream").Duplex : true;
but this fails, so I'm not sure what to replace false with in order to get this working and passing tests so the fix can be merged.
I am trying to use PapaParse in the browser to parse a file using:
I am bundling my javascript with the below rollup config which handles bare module specifiers:
and then importing PapaParse with
import Papa from "papaparse";
, however I get the following build error from rollup:and the following error in the browser: