react-native run-ios doesn't show log in react packager - react-native

I need some help on the "react-native run-iso". There is no error, but the react packager doesn't show the action log with time. Does anyone know what is wrong? Thanks!
react-native-cli: 2.0.1
react-native: 0.48.3
watchman: 4.9.0
node: v8.5.0
The following is what the packager showed after run the app.
┌────────────────────────────────────────────────────────────────────────────┐
│ Running packager on port 8081. │
│ │
│ Keep this packager running while developing on any JS projects. Feel │
│ free to close this tab and run your own packager instance if you │
│ prefer. │
│ │
│ https://github.com/facebook/react-native │
│ │
└────────────────────────────────────────────────────────────────────────────┘
Looking for JS files in
/Users/panda/PandaApp
React packager ready.
Loading dependency graph, done.
Bundling index.ios.js [development, non-minified, hmr disabled] 100.0% (301/301), done.

If I understand your question correctly, you're trying to view the iOS logs? Did you try to run the command react-native log-ios in a new terminal tab?

Well just in case you are referring to your applications logs you need to access the react native developers tools once you app is opened and the enable remote debugging which would open a new tab on your browser and then there you can open the browser console and see the outputs logs of your application

There is a typo in your log command.
Its react-native log-ios and not react-native log-iso.

Related

React native monorepo with PNPM

My goal
I am trying to use React native monorepo with PNPM, because I need performance of pnpm.
Expected
I should be able to bundle React native app with pnpm android and start development server with pnpm start.
Actual results
I can bundle app, but I cant start metro server. I always get this error:
More info
I have node v16.14.2, react native v0.69.
I know default metro bundler doesn't support symlinks (https://github.com/pnpm/pnpm/issues/1252#issuecomment-667600769), which pnpm use, so I tried to patch metro in metro.config.js:
This works perfectly fine with pure React native repo like here e.g: https://github.com/gjhughes/react-native-pnpm-example
My project structure looks like this:
project
└───shared
└───backend
│ │ package.json
│
└───frontend
│ │ package.json
│
└───mobile-app
│ │ package.json
Here is my pnpm-workspace.yaml:
I am desperate. Is it even possible?
If you have any more questions, feel free to ask!
Use pnpm without symlinks. Create a .npmrc in the root of your monorepo with the following setting:
node-linker=hoisted
Remove node_modules and run pnpm install. Related docs: https://pnpm.io/npmrc#node-linker

Can't Import node_modules

I try to work with VueJs and PrimeVue in an existing Asp.Net Core project but I can't import the module. I guess my problem comes from the configuration of my project but I don't know how to solve it.
My project is an asp.net core project created in VS 2022. I installed npm with no particular option. After that, I installed PrimeVue and PimeIcons as it's shown on their site, that is :
npm install primevue#^3.17.0 --save
npm install primeicons --save
So my app tree is like this :
Project root folder
│ appsettings.Development.json
│ appsettings.json
│ ERP.csproj
│ package-lock.json
│ package.json
│ Program.cs
│ tsconfig.json
│
├───node_modules
│ │ .package-lock.json
│ ├───estree-walker
│ ├───jquery
│ ├───magic-string
│ ├───nanoid
│ ├───picocolors
│ ├───postcss
│ ├───primeicons
│ ├───primevue
│ ├───source-map
│ ├───source-map-js
│ ├───sourcemap-codec
│ └───vue
├───obj
├───Properties
├───Views
└───wwwroot
│ favicon.ico
├───css
├───js
├───lib
└───TSScripts
Then I make the import as their site says :
import PrimeVue from 'primevue/config';
import 'primeicons/primeicons.css';
But when I launch the app from VS, I have this error :
Uncaught TypeError: Failed to resolve module specifier "primevue/config". Relative references must start with either "/", "./", or "../".
so I tried :
import PrimeVue from './primevue/config';
import './primeicons/primeicons.css';
result :
Failed to load resource: the server responded with a status of 404 () :7080/js/Partenaires/primevue/config:1
Failed to load resource: the server responded with a status of 404 () :7080/js/Partenaires/primeicons/primeicons.css:1
It seems that the files should be in the wwwroot folder instead of the root/node_modules folder.
I had a similar problem with my TypeScript files, there were in a folder in the root and the app didn't find them. I had to move the folder in the wwwroot folder to solve it without being sure it's the good way to do (see : TypeScript folder is missing when launching app)
Can someone explain me what should I do to solve this problem ?
Thank you.
Philippe
Didn't saw your project structure before.
Make sure, that you use vite to create your project. Follow the guide at https://vitejs.dev/guide/#scaffolding-your-first-vite-project.
It would honestly be easier to just create a new project instead of finding the issue with your current setup.

how to fix vue-cli-service vulnerability?

I just tried creating a new project with #vue/cli 4.3.1, fresh install of Ubuntu 19.10, npm 6.14.4. When I cd into the project and run npm install, I get the following:
found 1 high severity vulnerability
run `npm audit fix` to fix them, or `npm audit` for details
Running npm audit fix produces
fixed 0 of 1 vulnerability in 1285 scanned packages
1 vulnerability required manual review and could not be updated
Upon running npm audit, I get
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High │ Denial of Service │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ http-proxy │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ No patch available │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ #vue/cli-service [dev] │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ #vue/cli-service > webpack-dev-server > │
│ │ http-proxy-middleware > http-proxy │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://npmjs.com/advisories/1486 │
└───────────────┴──────────────────────────────────────────────────────────────┘
Is this expected? Normal? Possible to fix? It worries me that this happens with such a clean environment where nothing malicious was installed, but then I'm also not an npm expert... What should I do here?
I was setting up a new Vue project and got the same issue. I was able to find a post on Github Vue/Vue-cli where they address the issue:
https://github.com/vuejs/vue-cli/issues/5489#issuecomment-629326414
That post says they are tracking the issue, but as a note:
Note: as it's only used for the local development server, it's not an
actual security vulnerability on Vue CLI projects. Feel free to ignore
it if #vue/cli-service is the only source of this dependency in your
project.
So, I have gone ahead and ignored it for the time being. I hope that when they update the NPM package, it will use an updated http-proxy, which addresses the issue.
According to the tracker itself, it says it is fixed in http-proxy version 1.18.1.
I suggest, before creating vue cli project, upgrade node and npm to the newest versions available. I've had the same problem and this solved it partially for me(from 108 vulnerabilities before, to 45 after).
No fixes are currently available for these issues.
npm recommends considering using another package until a patch is available

getting error "error: unknown option `--nonPersistent" when using expo publish

I have build an app using expo init and it is working perfectly fine with "expo start". But when I wanted to publish it using "expo publish", i get the error.
(base) hemant#hemant-hp:~/Desktop/Chatter-Native$ expo publish
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ │
│ There is a new version of expo-cli available (3.11.2). │
│ You are currently using expo-cli 3.2.3 │
│ Install expo-cli globally using the package manager of your choice; for example: `npm install -g expo-cli` to get the latest version │
│ │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Unable to find an existing Expo CLI instance for this directory, starting a new one...
error: unknown option `--nonPersistent'
Metro Bundler process exited with code 1
Set EXPO_DEBUG=true in your env to view the stack trace.
(base) hemant#hemant-hp:~/Desktop/Chatter-Native$
maybe it's because you are using a old version of expo-cli, upgrade your expo-cli and try again. you can get a more detailed log of your error runing $export EXPO_DEBUG=true and runing again expo publish

React Native cannot find entry file in any of the roots

Description
Cloned a repo to a new computer and getting the following error:
swipes#0.0.1 start C:\a\swipes-api\mobile
node node_modules/react-native/local-cli/cli.js start
Scanning 722 folders for symlinks in C:\a\swipes-api\mobile\node_modules (30ms)
┌────────────────────────────────────────────────────────────────────────────┐
│ Running packager on port 8081. │
│ │
│ Keep this packager running while developing on any JS projects. Feel │
│ free to close this tab and run your own packager instance if you │
│ prefer. │
│ │
│ https://github.com/facebook/react-native │
│ │
└────────────────────────────────────────────────────────────────────────────┘
Looking for JS files in
C:\a\swipes-api\mobile
error: bundling: NotFoundError: Cannot find entry file index.android.js in any of the roots: ["C:\\a\\swipes-api\\mobile"]
at DependencyGraph._getAbsolutePath (C:/a/swipes-api/mobile/node_modules/react-native/packager/src/node-haste/DependencyGraph.js:280:11)
at DependencyGraph.getDependencies (C:/a/swipes-api/mobile/node_modules/react-native/packager/src/node-haste/DependencyGraph.js:218:26)
at Resolver.getDependencies (C:/a/swipes-api/mobile/node_modules/react-native/packager/src/Resolver/index.js:107:27)
at C:/a/swipes-api/mobile/node_modules/react-native/packager/src/Bundler/index.js:591:37
at next (native)
at step (C:\a\swipes-api\mobile\node_modules\react-native\packager\src\Bundler\index.js:12:445)
at C:\a\swipes-api\mobile\node_modules\react-native\packager\src\Bundler\index.js:12:605
at process._tickCallback (internal/process/next_tick.js:103:7)
Bundling `index.android.js` 0.0% (0/1), failed.
The path is correct where it's searching from. I've been stuck with this for the whole day now.
Is this somehow because there are double backslashes in the path to the index file?
npm start -- --reset-cache results in the same error.
Running yarn start after react-native run-android results in the same issue as well.
npm run start -- --root C:\a\swipes-api\mobile - No result.
This does not seem to be connected to the previous issue in the RN 0.45.0.
Additional Information
React Native version: 0.45.1
Platform: Android
Development Operating System: Windows
Edit:
All new projects with react-native init result in the same issue. Seems to be an issue with the config of my computer or npm, but I can't seem to track down why this happens.
Any ideas?
I have this and some like this error on windows.
Updating the npm and the node helped me on this issue.
currently i have:
C:\usr\Far>node -v && npm -v
v6.11.1
3.10.10
Many trials to run was not successful at all until I do not update. Anyway some errors like this appear time to time. Just restart. Also helpful to do before restart (but may be not need, just restart):
sh -c 'rm -rf $TMP/react*'
npm cache clean
Where $TMP is your system tmp directory, (check for existence react temp files there)
If you add or update some packages or some like that modifications concerning node_modules directory need to do also:
rm -rf node_modules && npm install