fbt internationalization: ERROR in ./src/example/Example.react.js Module not found: Error: Can't resolve 'fbt' - reactjs

I try to use new internationalization library from facebook - fbt, I follow by steps in doc:
git clone git#github.com:facebookincubator/fbt.git;
cd fbt/demo-app;
yarn install; # pull in dependencies
yarn manifest; # generate fbt enum manifests and source manifests
yarn collect-fbts; # Collect all fbt phrases from source
yarn translate-fbts; # Generate the translation payloads
yarn build;
yarn start; # Checkout your locally running server at localhost:8081
And in next I got next error on yarn build step:
ERROR in ./src/example/Example.react.js
Module not found: Error: Can't resolve 'fbt' in '/home/test/projects/fbt/demo-app/src/example'
# ./src/example/Example.react.js 36:0-80 37:0-4 100:17-31 104:18-29 113:6-23 141:9-12 143:43-46 145:43-46 159:10-27 164:15-29 165:9-12 168:15-29 169:9-12 172:15-29 173:9-12 176:15-29 177:9-12 185:21-24 198:21-24 219:15-29 220:9-12 223:15-29 224:9-12 227:15-29 228:9-12 231:15-29 232:9-12 236:9-12 238:10-13 240:58-61 243:9-12 246:10-13 256:21-24 289:15-26 290:9-12 293:15-26 294:9-12 297:15-26 298:9-12 301:15-26 302:9-12 305:15-26 306:9-12 309:15-26 310:9-12 314:9-12 340:10-13 344:32-35 344:78-81 346:9-12 346:27-30 348:9-12 352:12-15 362:9-12
# ./src/root.js

My apologies! It looks like we were missing a step in our documentation! You'll need to run yarn in the top-level first (to build the runtime library):
git clone git#github.com:facebookincubator/fbt.git;
cd fbt;
yarn;
cd demo-app
yarn ...

Related

Getting nx format:write uncommitted failed without output and eslint --fix failed without output error when I do git commit

Getting nx format:write --uncommitted failed and eslint --fix failed without output error when I try to do git commit
When I try to do git commit it is showing as below
Running tasks for staged files...
.lintstagedrc.json 1 file $schema no files [SKIPPED]
{apps, libs}/**/*. {ts, tsx, js, jsx) - 1 file * eslint-fix [KILLED]
.(ts, tsx, js, jsx, json, nd, arc) 1 file nx format:write -uncommitted [SIGSEGV] Skipped because of errors from tasks. [SKIPPED]
I
✓ Reverting to original state because of errors...
✓ Cleaning up temporary files...
*nx format:write -uncommitted failed without output (SIGSEGV).
eslint --fix failed without output

React: max_user_watches is set to 524288, still showing ENOSPC: System limit for number of file watchers reached

I have cloned the project and trying to run it for the first time in my system (Ubuntu 18.04.3 LTS) with npm serve, but I am getting the following error:
events.js:174
throw er; // Unhandled 'error' event
^
Error: ENOSPC: System limit for number of file watchers reached, watch '/home/bs-094/Dev/FPN/fpn-frontend/public'
at FSWatcher.start (internal/fs/watchers.js:165:26)
at Object.watch (fs.js:1258:11)
at createFsWatchInstance (/home/bs-094/Dev/FPN/fpn-frontend/node_modules/chokidar/lib/nodefs-handler.js:38:15)
at setFsWatchListener (/home/bs-094/Dev/FPN/fpn-frontend/node_modules/chokidar/lib/nodefs-handler.js:81:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/bs-094/Dev/FPN/fpn-frontend/node_modules/chokidar/lib/nodefs-handler.js:233:14)
at FSWatcher.NodeFsHandler._handleDir (/home/bs-094/Dev/FPN/fpn-frontend/node_modules/chokidar/lib/nodefs-handler.js:429:19)
at FSWatcher.<anonymous> (/home/bs-094/Dev/FPN/fpn-frontend/node_modules/chokidar/lib/nodefs-handler.js:477:19)
at FSWatcher.<anonymous> (/home/bs-094/Dev/FPN/fpn-frontend/node_modules/chokidar/lib/nodefs-handler.js:482:16)
at FSReqWrap.oncomplete (fs.js:154:5)
Emitted 'error' event at:
at FSWatcher._handleError (/home/bs-094/Dev/FPN/fpn-frontend/node_modules/chokidar/index.js:260:10)
at createFsWatchInstance (/home/bs-094/Dev/FPN/fpn-frontend/node_modules/chokidar/lib/nodefs-handler.js:40:5)
at setFsWatchListener (/home/bs-094/Dev/FPN/fpn-frontend/node_modules/chokidar/lib/nodefs-handler.js:81:15)
[... lines matching original stack trace ...]
at FSReqWrap.oncomplete (fs.js:154:5)
I have looked up the solution here & here, but my /etc/sysctl.conf has already fs.inotify.max_user_watches=524288 added in its last line. I have read that 524,288 is the maximum number of files that can be watched. So I am completely clueless on how to listen to my files i.e run my project.
How can I run this?
This worked for me! First,
$ echo 'fs.inotify.max_user_watches=524288' | sudo tee -a /etc/sysctl.conf
The new value can then be loaded/sourced by running:
$ sudo sysctl -p
As increasing the limit didn't work for me, I tried a different approach. I didn't add my node_modules files to the watcher.
From my experience the best fix would be to expose the watcher configuration where one could define to ignore any folders or files of their choosing, not just node_modules.

pkg_resources.ResolutionError not found

I tried install a package in python3 called Spexxy, using this:
pip3 install -r requirements.txt
python3 setup.py install
Using iPython in the shell, I can well import the package with import spexxy but when I try to use anything from the package, first I have to use an exclamation point before the command like for example !spexxytools grid create, otherwise I have the error:
File "<ipython-input-3-b744a07ba8b3>", line 1
spexxytools grid create --from-filename "lte(?P<Teff>\d{5})-(?P<logg>\d\.\d\d)(?P<FeH>[+-]\d\.\d)(\.Alpha=(?P<Alpha>[+-]\d\.\d\d))?\.PHOENIX"
^
SyntaxError: invalid syntax
But even when using the exclamation point, I now have the error:
File "/home/geoffrey/.local/bin/spexxy", line 4, in <module>
__import__('pkg_resources').run_script('spexxy==2.3', 'spexxy')
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 658, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1429, in run_script
.format(**locals()),
pkg_resources.ResolutionError: Script 'scripts/spexxy' not found in metadata at '/home/geoffrey/.local/lib/python3.6/site-packages/spexxy-2.3.dist-info'
Can you help me find what's wrong ?
setuptools.find_packages()
Packages are only recognized if they include an init.py file.
So if you put
...
packages = setuptools.find_packages(),
...
scripts=['scripts/spexxy'],
you will get this error.
To fix it either write spexxy as a module in your source or declare packages = manually instead of using find_packages().
Edit
spexxy setup.py is using
packages=find_packages(include=['spexxy', 'spexxy.*']),
scripts=['bin/spexxy', 'bin/spexxytools'],
But the bin directory is missing, so it should be:
packages=find_packages(include=['spexxy', 'spexxy.*', 'bin/*']),
scripts=['bin/spexxy', 'bin/spexxytools'],

AOSP Build TARGET_PRODUCT fails

I'm trying to build an external tool with AOSP. My OS is Linux, Distribution ArchLinux (i3wm), but to compile AOSP I use Ubuntu in Docker (https://android.googlesource.com/platform/build/+/master/tools/docker)
First step:
# init repo
repo init -u https://android.googlesource.com/platform/manifest -b android-8.0.0_r36 --depth=1
repo sync
. build/envsetup.sh # set up environment
lunch aosp_arm-eng # select target to build
Second step: select tool and build
cd external/selinux
mma -j48
Output:
ninja: error: unknown target 'MODULES-IN-'
15:41:55 ninja failed with: exit status 1
make: *** [run_soong_ui] Error 1
make: Leaving directory `/home/user/aosp'
#### make failed to build some targets (6 seconds) ###
Another tool
cd external/wpa_supplicant_8
mma -j48
Output:
ninja: error: unknown target 'MODULES-IN-external-wpa_supplicant_8'
15:41:55 ninja failed with: exit status 1
make: *** [run_soong_ui] Error 1
make: Leaving directory `/home/user/aosp'
#### make failed to build some targets (2 seconds) ###
This happens with any aosp generic target:
Lunch menu... pick a combo:
1. aosp_arm-eng # fails
2. aosp_arm64-eng # fails
3. aosp_mips-eng # fails
4. aosp_mips64-eng # fails
5. aosp_x86-eng # fails
6. aosp_x86_64-eng # fails
7. full_fugu-userdebug # works
8. aosp_fugu-userdebug # works
9. car_emu_arm64-userdebug # fails
10. car_emu_arm-userdebug # fails
11. car_emu_x86_64-userdebug # fails
12. car_emu_x86-userdebug # fails
13. mini_emulator_arm64-userdebug # fails
14. m_e_arm-userdebug # fails
15. m_e_mips64-eng # fails
16. m_e_mips-userdebug # fails
17. mini_emulator_x86_64-userdebug # fails
18. mini_emulator_x86-userdebug # fails
19. aosp_dragon-userdebug # works
20. aosp_dragon-eng # works
21. aosp_marlin-userdebug # works
22. aosp_marlin_svelte-userdebug # works
23. aosp_sailfish-userdebug # works
24. aosp_angler-userdebug # works
25. aosp_bullhead-userdebug # works
26. aosp_bullhead_svelte-userdebug # works
27. hikey-userdebug # works
I want to compile some binary tools in all arch: arm, arm64, x86 and x86_64.
Why aosp_arm-eng does not work? Or how can I change the CPU architecture from non generic aosp target?
Using tapas does not work.
You probably need to make a full AOSP build before trying to use mm... shortcuts - looks like some build script files were not generated yet.
clear all the binaries from /out dir with make clean command & then try to make a full build
Actually there is no need to do a full build. Just open your Android.mk or Android.bp of the module you want to build, and look for variable MODULE_NAME.
Then from the root of the project make
mm $MODULE_NAME
It should build all the dependencies you need first.
I suggest that use the mmm command for building. Also make sure that the directory you are pointing to contains a Android.bp or Android.mk
mmm /external/selinux
Also I suggest to clean the outputs by remove the out directory or simply run:
make clean
If still you have that problem, remove the --depth=1 argument on repo init and sync it again. that argument limits the commit fetching from remote branch.
Use below commands to compile module from root dir
Goto root dir
make clean
source build/envsetup.sh
lunch "select option"
make "module name" -j8

React Native Debugger Error - Cannot GET /debugger-ui/

React Native Debugger is automatically loading to http://localhost:8081/debugger-ui/.
However, I keep getting the following error -
Cannot GET /debugger-ui/
Apparently they have left a bug in the code. For it to work right now, you will have to change the react-native-community module on your own.
Go to the file
/node_modules/react-native-community/cli/build/commands/server/middleware/MiddlewareManager.js
and, in the line 97
const debuggerUIFolder = _path().default.join(__dirname, '..', 'util',
'debugger-ui');
remove the 'util' param, changing it to
const debuggerUIFolder = _path().default.join(__dirname, '..',
'debugger-ui');
For me it was only:
rm -rf node_modules && npm i
npm run start -- -- reset-cache
cd ios && rm -rf Pods && pod install

Resources