flatbuffers icon indicating copy to clipboard operation
flatbuffers copied to clipboard

no exported member ``Long``

Open marwie opened this issue 2 years ago • 12 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.

marwie avatar Apr 20 '22 11:04 marwie

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.

marwie avatar Apr 20 '22 12:04 marwie

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?

marwie avatar Apr 20 '22 12:04 marwie

@bjornharrtell

dbaileychess avatar Apr 20 '22 22:04 dbaileychess

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 avatar Apr 21 '22 06:04 bjornharrtell

@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 avatar Apr 21 '22 07:04 marwie

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

bjornharrtell avatar Apr 21 '22 07:04 bjornharrtell

@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.

bjornharrtell avatar Apr 21 '22 07:04 bjornharrtell

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

marwie avatar Apr 21 '22 08:04 marwie

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

sketch34 avatar May 03 '22 13:05 sketch34

Hello, have newer flatbuffer 2.0.x releases the long type again?

marwie avatar Sep 13 '22 07:09 marwie

There is an updated TS release.

Long is still uising BigInt, but it should be convertible?

@bjornharrtell

dbaileychess avatar Sep 13 '22 15:09 dbaileychess

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.

bjornharrtell avatar Sep 13 '22 16:09 bjornharrtell

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.

github-actions[bot] avatar Mar 14 '23 20:03 github-actions[bot]

This issue was automatically closed due to no activity for 6 months plus the 14 day notice period.

github-actions[bot] avatar Mar 29 '23 20:03 github-actions[bot]