rrweb-io / rrweb

record and replay the web
https://www.rrweb.io/
MIT License
16.75k stars 1.43k forks source link

[Bug]: Typescript errors when building with rrweb #1559

Open cnguyen0 opened 2 months ago

cnguyen0 commented 2 months ago

Preflight Checklist

What package is this bug report for?

rrweb

Version

v2.0.0-alpha.14

Expected Behavior

I should be able to build my local package with no typescript errors from any rrweb dependencies

Actual Behavior

Since upgrading from rrweb@2.0.0-alpha.11 -> rrweb@2.0.0-alpha.14, I've been getting typescript errors every time I build my application (see screenshots below).

It's coming from dev dependencies rrdom. Looking at the version's release of rrdom, I'm not seeing any new changes that might have caused it. I'm thinking it could be a package version incompatibility? Both the application and rrweb are using "typescript": "^5.4.5",.

My TS config is set up like this. I'm wondering if there's any in the config that is causing the build issue.

{
  "compilerOptions": {
    "allowJs": true,
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": false,
    "forceConsistentCasingInFileNames": true,
    "isolatedModules": true,
    "jsx": "react-jsx",
    "jsxImportSource": "preact",
    "lib": ["DOM", "DOM.Iterable", "ESNext"],
    "module": "ESNext",
    "moduleResolution": "Bundler",
    "noEmit": true,
    "paths": {
      "react": ["./node_modules/preact/compat/"],
      "react-dom": ["./node_modules/preact/compat/"]
    },
    "resolveJsonModule": true,
    "skipLibCheck": false,
    "strict": true,
    "target": "ESNext",
    "useDefineForClassFields": true
  },
}

Any ideas here on resolving my build issue? Much appreciated.

Screenshot 2024-08-26 at 5 02 33 PM

Steps to Reproduce

  1. Set rrweb version to rrweb@2.0.0-alpha.14
  2. npm i
  3. Build own application

Testcase Gist URL

No response

Additional Information

No response

rodrigopavan commented 2 months ago

Same here. Is someone looking at this?

fadi-george commented 3 weeks ago

I believe this would happen if skipLibCheck is true so might be a typo in your description. Would have to set skipLibCheck to false but ideally the typings would get fixed.