google / flatbuffers

FlatBuffers: Memory Efficient Serialization Library

Home Page:http://google.github.io/flatbuffers/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

no exported member ``Long``

marwie opened this issue · comments

Hello,

I've been using flatbuffers v2.0.4 for some months now in my typescript project. But since this morning I'm getting the following error message when trying to build:

module flatbuffers has no exported member named Long

I'm importing it as import { Builder, Long } from "flatbuffers";

I dont think this is an error directly related to flatbuffers (?) but I wonder if anyone has an idea why it suddenly pops up and how to fix/workaround it when using long/bigint?

Needles to say I can't compile my schemes as well anymore.

Ah just noticed #6998
due to ^2.0.4 it implictly updated to 2.0.6 and broke my code.

How should I handle compiling my ts schemes now?

Running flatc --ts myscheme.fbs still produces code like this: time():flatbuffers.Long and this.bb!.createLong(0, 0) which throws errors now. Is there a more recent flatc compiler available?

Long has been removed entirely and replaced with native BigInt support. See #6998.

This change deserved more than a patch level bump, which I wrote at #6998 (comment). I can however fully understand that comment was missed/forgotten and tracking and bumping major version level per individual language support is difficult for a project like this.

@marwie which version of flatc are you using? I believe it should work since #6998 but you might need to compile it yourself.

@bjornharrtell I've downloaded the flatc version from releases (2.0.0) - do you have any info on when a new release (pre-compiled version) will be officially available?

@marwie sorry no, I'm maintainer (free time only) of the TS/JS parts only.

@dbaileychess it would make sense to me that if there is an official 2.0.0 compiled flatc that a new release is cut since there are (unintended patch level) breaking changes in code generation.

Thank you @bjornharrtell ! Maybe someone else has info on a timeframe for the next release?

I'm encountering the same issue. I'm on the latest flatbuffers vcpkg port (2.0.0 port version 3) and flatbuffers npm 2.0.6.

Would this help?
microsoft/vcpkg#24208

ezoic increase your site revenue