-
Notifications
You must be signed in to change notification settings - Fork 13
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
TS Error: Namespace 'Intl' has no exported member 'Segmenter' #37
Comments
@jspizziri Unfortunately at the moment parts of the ts-toolkit are not NodeJS-compatible, in fact I've never actually tested running it in a NodeJS env. It's definitely possible to do for the That specific API is from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter |
@chocolatkey , thanks for the response! So... I feel like a huge idiot now, so I'm sorry for how stupid this next question must sound. If you're not using NodeJS, what runtime are you using to build? I noticed in the GitHub workflow, the CI job seems to at least reference node. Also, I did see that web spec you referenced, so I assumed it was just some sort of TS targeting issue. I haven't really looked at this project to much until just now as we've been using another epub readium reader (R2D2BC). Again, the more I write this the more I feel like I'm an idiot, so I apologize if I'm missing some sort of fundamental concept or doc I should've read. |
Also, in case this is helpful context: the reason I care is that react-native-readium currently supports web in addition to Android and iOS (which is where I'm leveraging the dependency of the EDIT: Also, I am potentially interested in helping with node support, but I feel like I don't know enough to be able know if I need that or not. |
@jspizziri Basically, there were maintainers for the ts-toolkit before me, and one of them wrote the majority of what is now the I'd be interested in having non-web users of the |
@chocolatkey , I'd be happy to try and pitch in on node compatibility and documentation. I worry that, due to my lack of knowledge about the lib that I'll end up just asking you a ton of questions. If I were to pitch in, it sounds like these might be some areas that would be helpful:
If that sounds like it might be helpful just let me know, and, if so, if you could provide any top level guidance for how you're interacting with the build of the packages and running of the test app that'd be great. Thanks again! |
It appears this issue (the issue in my initial report) is related to the As such, It looks like migrating away from it as the build tool is the best solution. LMK your thoughts. |
@jspizziri I'm very sorry about the delay, I ended up very busy and then on a trip. I agree that we need to replace the build tool, since it cannot support the newer TS features beyond ES2020 and is no longer maintained. I've been trying out a new build "system" for the vanilla testapp using tsc and vite, but I'm sure there are many options out there. P.S. I've removed the |
I just attempted to clone and built the project and ran into the following typescript error:
Repro steps:
git clone [email protected]:readium/ts-toolkit.git
cd ts-toolkit
pnpm install
If I simply add some
@ts-ignore
's to theTextTokenizer.ts
(lines 40 & 50) the install completes successfully.Environment:
macOS@14
[email protected]
[email protected]
The text was updated successfully, but these errors were encountered: