flatbuffers
flatbuffers copied to clipboard
no exported member ``Long``
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 https://github.com/google/flatbuffers/pull/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?
@bjornharrtell
Long has been removed entirely and replaced with native BigInt support. See https://github.com/google/flatbuffers/pull/6998.
This change deserved more than a patch level bump, which I wrote at https://github.com/google/flatbuffers/pull/6998#discussion_r779611994. 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? https://github.com/microsoft/vcpkg/pull/24208
Hello, have newer flatbuffer 2.0.x releases the long type again?
There is an updated TS release.
Long is still uising BigInt, but it should be convertible?
@bjornharrtell
Long is replaced by BigInt support and it was intentionally a breaking change with no intention to support Long going forward in 2.x. See https://github.com/google/flatbuffers/issues/6289 for original issue and note that the intention to make it a breaking change in 2.x is now soon two years old, while it took a year before it actually was implemented in https://github.com/google/flatbuffers/pull/6996.
It should have been handled better and removed in the initial 2.x release with proper obsoletion documentation but it is what it is. I don't think that is a good argument enough to reinstate it, but won't be totally against someone contributing it back if possible.
This issue is stale because it has been open 6 months with no activity. Please comment or label not-stale
, or this will be closed in 14 days.
This issue was automatically closed due to no activity for 6 months plus the 14 day notice period.