facade / flare-client-js

The JavaScript client for Flare, to catch any frontend errors.
https://flareapp.io
Other
3 stars 4 forks source link

Typescript errors when building project with flare-react #117

Closed dennisnotebaart closed 9 months ago

dennisnotebaart commented 1 year ago

Description

We have a Laravel project with an Inertia/React/TypeScript front-end. After adding the Flare React client we get TypeScript errors from the flare-react package when running npm buid.

I've confirmed this is also the case in a fresh project.

Errors

node_modules/@flareapp/flare-react/dist/react/src/index.d.ts:6:19 
error TS2307: Cannot find module '../../client/dist/FlareClient' or its corresponding type declarations.
6     flare: import("../../client/dist/FlareClient").default | null;
node_modules/@flareapp/flare-react/dist/react/src/index.d.ts:11:96 
error TS2304: Cannot find name 'Flare'.
11 export declare function reportReactError(error: Error, reactErrorInfo: React.ErrorInfo, flare: Flare | null): void;

How to reproduce

ignasradzius commented 10 months ago

Ran into the same problem. @dennisnotebaart did you manage to find a workaround? @riasvdv @AdrianMrn

dennisnotebaart commented 10 months ago

@ignasradzius I've contacted support and was told they're working on a new version of the package. You can use the vanilla JS client in the meantime.

sebastiandedeyne commented 9 months ago

Hi!

Thanks everyone for your patience with this issue. We just tagged a beta version of our new JavaScript packages, with stable version coming next week!

If you already want to give them a try, you can install the following packages (they've been slightly renamed):

"dependencies": {
  "@flareapp/js": "^1.0.0-beta",
  "@flareapp/react": "^1.0.0-beta",
  "@flareapp/vue": "^1.0.0-beta"
},
"devDependencies": {
  "@flareapp/vite": "^1.0.0-beta"
}