Following the official guide, I get the following error:
ReferenceError: exports is not defined in ES module scope
This file is being treated as an ES module because it has a '.js' file extension and 'C:\project\node_modules\rrweb\package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
Steps to Reproduce
Create a NextJS app (could be a simple React app as well)
Install rrweb yarn add rrweb
Import inside your component import * as rrweb from 'rrweb';
Preflight Checklist
What package is this bug report for?
rrweb
Version
2.0.0-alpha.4
Expected Behavior
After installing rrweb with
yarn add rrweb
, and importing into my component:I should be able to start recording events:
Actual Behavior
Following the official guide, I get the following error:
Steps to Reproduce
yarn add rrweb
import * as rrweb from 'rrweb';
Testcase Gist URL
No response
Additional Information
No response