rollup/stream

@rollup/stream incompatible with current nodejs?

schrotie opened this issue · 1 comments

  • @rollup/stream Version: 1.0.0
  • Rollup Version: 2.18.2
  • Operating System (or Browser): Ubuntu 18.4
  • Node Version: 13.5.0

How Do We Reproduce?

Load @rollup/stream via require in new node

I did not isolate the problem since to me it looks pretty self-explanatory. But I may be mistaken and maybe the problem is even somehow in my code. So if you don't see the problem, please let me know and I'll try to isolate it.

Expected Behavior

Script is loaded

Actual Behavior

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /my/path/node_modules/rollup/dist/es/rollup.browser.js
require() of ES modules is not supported.
require() of /my/path/node_modules/rollup/dist/es/rollup.browser.js from /my/path/node_modules/@rollup/stream/dist/index.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename rollup.browser.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /my/path/node_modules/rollup/dist/es/package.json.

Sorry, moved to rollup ...