-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: can't access dead object #743
Comments
Hi @eduardoportilho. Your issue looks very similar to #691. Please look through that thread, it should help to fix your case. If it doesn't, please provide us more specific steps and code examples to reproduce the error. |
Hello @Finesse. This issue was caught in production and it has happened several times, but I couldn't find a way to reproduce it based on the logged info. I know that it only happens in Firefox in this line of (un-minified) code:
Maybe the user has some kind of browser extension that is causing it? I'll try to catch the error as suggested in the linked issue and see if I can get more information. Thanks for the help 🙇 |
@eduardoportilho Could you please provide a code snippet that shows how you use the library? Do you run it in an iframe or other unusual conditions? |
@eduardoportilho The error messages can be cause by an issue fixed in version 3.3.1. Please try to update the library and check whether the error still occurs. |
Sure: export const useFingerprint = () => {
// Initialize fingerprint agent
const fpPromise = useRef(FingerprintJS.load())
const isMounted = useRef(true)
const [fingerprint, setFingerprint] = useState<
FingerprintPayload | undefined
>(undefined)
async function getFingerprint() {
try {
const fp = await fpPromise.current
const { visitorId, components } = await fp.get()
Object.entries(components).forEach(([key, { value }]) => {
components[key] = value
})
if (isMounted.current) {
setFingerprint({
...components,
visitorId
})
}
} catch (error) {
Sentry.captureException(error)
}
}
useEffect(() => {
isMounted.current = true
return () => {
isMounted.current = false
}
}, [])
useEffect(() => {
if (!fingerprint) {
getFingerprint()
}
}, [fingerprint])
return fingerprint
}
No, regular conditions. |
@eduardoportilho as a side note, it looks you're using FingerprintJS in a React application. |
@Valve sure, I can propose this to our team |
@eduardoportilho Did you try to update the library to version 3.3.3?
This is incorrect because a new library instance will be created on every render. You need only 1 instance of FingerprintJS. You should call Please fix this too. |
Scenario
The following error is being reported in my app logs:
Device: Mac OS X 10.15
Browser: Firefox 96.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:96.0) Gecko/20100101 Firefox/96.0
@fingerprintjs/fingerprintjs: 3.3.0
The text was updated successfully, but these errors were encountered: