You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 18, 2024. It is now read-only.
When running fbt-collect on a Typescript file, it errors out with syntax errors due to Babel not recognizing Typescript-specific syntax. In order to have have Babel understand this syntax, you need to run Babel with the Typescript preset. However, presets are not currently a supported option on the cli. I will be submitting a pull request that adds this as an ability, which allows me to successfully use fbt-collect on a .tsx file.
To Reproduce
Run fbt-collect on a .tsx file that has Typescript-specific syntax
Expected behavior
fbt-collect collects the strings without erroring, just like it would on a .jsx file
@retyui no worries man. I’ve also seen this article which has more info - https://medium.com/@frenchyooy/configuring-fbt-api-with-typescript-and-react-create-app-492ee72f44bb. We have fbt working nowadays in our typescript project. My only thing is that I’m hoping that the team will accept the PR I submitted for setting a Babel preset for the collect CLI to use. The import problem you mention may be a known issue #115 btw, tho it looks like it might be a little stale as it is tagged Needs Repro. I can confirm that we reproduced an import problem with our set up. Needed to put “fbt;” somewhere in the file to get it to work. This particular issue here tho is just about getting the fbt-collect CLI to be easily usable with typescript as I think is a goal of the project.
🐛 Bug Report
When running fbt-collect on a Typescript file, it errors out with syntax errors due to Babel not recognizing Typescript-specific syntax. In order to have have Babel understand this syntax, you need to run Babel with the Typescript preset. However, presets are not currently a supported option on the cli. I will be submitting a pull request that adds this as an ability, which allows me to successfully use fbt-collect on a .tsx file.
To Reproduce
Expected behavior
Link to repo (highly encouraged) or paste
N/A
envinfo
System:
OS: macOS 10.15.4
CPU: (16) x64 Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
Memory: 1.30 GB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 13.13.0 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.4 - /usr/local/bin/npm
The text was updated successfully, but these errors were encountered: