Skip to content
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

Incorrect Result: TypeError: c.openSync is not a function at p (find.ts:111:1) #180

Closed
PedroRamosForte opened this issue Oct 14, 2024 · 5 comments

Comments

@PedroRamosForte
Copy link

PedroRamosForte commented Oct 14, 2024

Query Details

Input Coordinates: -29.771706356994166, -57.08456733482596

Expected Result: ['America/Sao_Paulo']

Actual Result: ERROR

Dataset: "Alike since 1970"

Discussion

It looks like it is a bug in this specific coordinates, for all other coordinates we tested in our software it works fine but there was one client in production using this coordinates and it resulted in a blank screen, we solved it with a try catch and a default value in case a problem happens.

I am using version 8.1.1, tried to upgrade to version 8.1.2 but same error occurs

Full error:

index.tsx:54 TypeError: c.openSync is not a function at p (find.ts:111:1) at find.ts:234:1 at push../node_modules/geo-tz/dist/find-1970.js.exports.find (find-1970.ts:24:1) at index.tsx:49:1 at invokePassiveEffectCreate (react-dom.development.js:23487:1) at HTMLUnknownElement.callCallback (react-dom.development.js:3945:1) at Object.invokeGuardedCallbackDev (react-dom.development.js:3994:1) at invokeGuardedCallback (react-dom.development.js:4056:1) at flushPassiveEffectsImpl (react-dom.development.js:23574:1) at unstable_runWithPriority (scheduler.development.js:468:1) at runWithPriority$1 (react-dom.development.js:11276:1) at flushPassiveEffects (react-dom.development.js:23447:1) at performSyncWorkOnRoot (react-dom.development.js:22269:1) at react-dom.development.js:11327:1 at unstable_runWithPriority (scheduler.development.js:468:1) at runWithPriority$1 (react-dom.development.js:11276:1) at flushSyncCallbackQueueImpl (react-dom.development.js:11322:1) at flushSyncCallbackQueue (react-dom.development.js:11309:1) at NotifyManager.batchedUpdates$1 [as batchNotifyFn] (react-dom.development.js:22387:1) at notifyManager.js:75:1
@evansiroky
Copy link
Owner

What is the build environment where this is happening?

@PedroRamosForte
Copy link
Author

I am using yarn
Node: 16.20.2
Yarn: 1.22.9
Typescript: 4.3.5
Ubuntu 22.04.5 LTS
tsconfig:
"compilerOptions": {
"target": "es2015",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
},
react version: ^17.0.2

@evansiroky
Copy link
Owner

Are you trying to build for a browser-based environment? node-geo-tz has some calls to the file system that may not be supported without additional bundling configuration magic. There is a "Bundlers" section in the readme that may point to some clues that may help figure out how to bundle.

@PedroRamosForte
Copy link
Author

Are you trying to build for a browser-based environment? node-geo-tz has some calls to the file system that may not be supported without additional bundling configuration magic. There is a "Bundlers" section in the readme that may point to some clues that may help figure out how to bundle.

Yes it is for a browser-based environment, I didn't notice that the library wasn't meant to be used like that, I didn't bother to look more into it because it worked right away, just those specific coordinates there is a problem, I probably will move this library to the backend then and access it via api in the frontend.

@evansiroky
Copy link
Owner

Sounds good. I'll go ahead and close the issue then as it's mostly a duplicate of #111.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants