Skip to content
This repository has been archived by the owner on Nov 18, 2024. It is now read-only.

yarn collect-fbts script error #145

Closed
hyochan opened this issue May 28, 2020 · 1 comment
Closed

yarn collect-fbts script error #145

hyochan opened this issue May 28, 2020 · 1 comment
Assignees

Comments

@hyochan
Copy link

hyochan commented May 28, 2020

🐛 Bug Report

Coming from #141. I am facing the below error in my boilerplate project built in the expo.

image

To Reproduce

Steps to reproduce the behavior:

1, git clone https://github.com/dooboolab/dooboo-expo.git
2. git checkout fbt
3. yarn
4. yarn manifest
5. yarn collect-fbts

Expected behavior

Correctly completes the script.

Link to repo (highly encouraged) or paste

https://github.com/dooboolab/dooboo-expo.git

  • branch: fbt

envinfo

  System:
    OS: macOS 10.15.4
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 55.79 MB / 32.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.14.1 - ~/.nvm/versions/node/v12.14.1/bin/node
    Yarn: 1.19.1 - /usr/local/bin/yarn
    npm: 6.13.4 - ~/.nvm/versions/node/v12.14.1/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
@kayhadrin
Copy link
Contributor

Thanks for submitting a repo to see the problem.

Well, it simply happens because the collect-fbts script is using the contents of i18n/fbt/.src_manifest.json (in your repo) to collect fbt strings but there simply isn't any.
That file is empty because your current repo does not contain any fbt() or callsite in the src folder.

If you add this code in App.tsx for example:

import fbt from 'fbt';
fbt('foo', 'bar');
const f = <fbt desc="test">foo</fbt>;

And then run yarn manifest && yarn collect-fbts, you should see a different result:
Actually, it's this other error...

Error: /.../dooboo-expo/src/App.tsx: Invalid option "__self". Only allowed: project, author, preserveWhitespace, subject, common, doNotExtract

Then you should follow the advice in that comment to workaround it: #137

And also add the --options __self to the collect-fbts yarn script.

Here's a patch to summarize the necessary changes: https://gist.github.com/kayhadrin/0429148128d1042f808666301c423c99

@kayhadrin kayhadrin self-assigned this May 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants