Closed evanmartiin closed 1 year ago
Hi, @evanmartiin
Thank you for reporting this issue and May I know have you tried with yarn package manager please ? I tried from my end with yarn to install all package dependancies and it's working as expected. For your reference I have added screenshot below. Meanwhile I will try to use npm package manager to use pose-detection
model from my end and I'll let you know but give it try with yarn package manager from your end and let us know whether is it working as expected or not ?
Please follow below steps :
https://github.com/tensorflow/tfjs-examples.git
pose-detection
folder using this command cd tfjs-examples/react-native/pose-detection
yarn
command in the terminal ( To install all package dependancies mentioned in the package.json)
yarn start
in the terminal Here is screenshot :
gaikwadrahul-macbookpro:TFJS-Cloned-Repo-For-Testing gaikwadrahul$ cd tfjs-examples/
gaikwadrahul-macbookpro:tfjs-examples gaikwadrahul$ cd react-native/
gaikwadrahul-macbookpro:react-native gaikwadrahul$ cd pose-detection/
gaikwadrahul-macbookpro:pose-detection gaikwadrahul$ pwd
/Users/gaikwadrahul/Desktop/TFJS-Cloned-Repo-For-Testing/tfjs-examples/react-native/pose-detection
gaikwadrahul-macbookpro:pose-detection gaikwadrahul$ yarn
yarn install v1.22.19
[1/4] 🔍 Resolving packages...
success Already up-to-date.
✨ Done in 0.27s.
gaikwadrahul-macbookpro:pose-detection gaikwadrahul$ yarn start
yarn run v1.22.19
$ expo start
Starting project at /Users/gaikwadrahul/Desktop/TFJS-Cloned-Repo-For-Testing/tfjs-examples/react-native/pose-detection
Some dependencies are incompatible with the installed expo version:
expo-camera@12.3.0 - expected version: ~12.5.0
react-native@0.69.3 - expected version: 0.69.9
Your project may not work correctly until you install the correct versions of the packages.
Install individual packages by running npx expo install expo-camera@~12.5.0 react-native@0.69.9
Starting Metro Bundler
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█ ▄▄▄▄▄ █ █▄▀▀▄▀█ ▄▄▄▄▄ █
█ █ █ █ ▀▄ █▀▄ ▄█ █ █ █
█ █▄▄▄█ █▀██▀▀ ▀▄██ █▄▄▄█ █
█▄▄▄▄▄▄▄█▄▀▄█ █▄█ █▄▄▄▄▄▄▄█
█ ██▄▄▄██▀▀▄▀▀▄ ▄██ ▀▄▄ ▄█
██ ▄ █ ▄ ██▀ ▄██ ▀▀ ▄ ▀██
█▀ ▄ ▄▄ ▄▀▄█▄▀▄▀▄▀▄▀▀▄ ▀██
███▀▀▀▄▄▄▀ ▀█▀██▄▄ ██▄ ▀███
█▄▄▄▄██▄▄ ▄ ▄▀▄ ▄ ▄▄▄ ▀ ▄▄█
█ ▄▄▄▄▄ █▀▄▀ ▄ ▄▀ █▄█ ▀▀███
█ █ █ █▄ ▄█▄ ▀█▄▄ ▄▄▀ █
█ █▄▄▄█ █▀███▀█▀▄▄▄ ▀█▀▀ ██
█▄▄▄▄▄▄▄█▄█▄▄█▄▄████▄▄▄▄▄▄█
› Metro waiting on exp://127.0.0.1:19000
› Scan the QR code above with Expo Go (Android) or the Camera app (iOS)
› Press a │ open Android
› Press i │ open iOS simulator
› Press w │ open web
› Press r │ reload app
› Press m │ toggle menu
› Press ? │ show all commands
Logs for your project will appear below. Press Ctrl+C to exit.
@gaikwadrahul8 thanks for your answer !
I tried running tfjs-examples/react-native/pose-detection
with yarn as you said, here is what I had on the page :
{"name":"pose-detection-expo","slug":"pose-detection-expo","version":"1.0.0","assetBundlePatterns":("*/"],"_internal":{"isDebug":false,"projectRoot":"[rootToExample]/.../tfjs-examples/react-native/pose-detection","dynamicConfigPath":null,"staticConfigPath":"[rootToExample]/.../tfjs-examples/react-native/pose-detection/app.json","packageJsonPath":"[rootToExample]/.../tfjs-examples/react-native/pose-detection/package.json"},"sdkVersion":"46.0.0","platforms":("ios","android"],"debuggerHost":"172.20.10.6:19000","logUrl":"http://172.20.10.6:19000/logs","developer":{"tool":"expo-cli","projectRoot":"[rootToExample]/.../tfjs-examples/react-native/pose-detection"},"packagerOpts":{"dev":true},"mainModuleName":"index","__flipperHack":"React Native packager is running","hostUri":"172.20.10.6:19000","bundleUrl":"http://172.20.10.6:19000/index.bundle?platform=ios&dev=true&hot=false","id":"@anonymous/pose-detection-expo-d56e8e08-fbfe-4e8c-b48a-bf9bf76739d0"}
Also, I tried, re-installing my own project with yarn instead of pnpm, and I had this error :
✘ [ERROR] Failed to resolve entry for package "ms". The package may have incorrect main/module/exports specified in its package.json. [plugin vite:dep-pre-bundle]
node_modules/esbuild/lib/main.js:1360:21:
1360 │ let result = await callback({
╵ ^
at packageEntryFailure (.../node_modules/vite/dist/node/chunks/dep-e8f070e8.js:23382:11)
at resolvePackageEntry (.../node_modules/vite/dist/node/chunks/dep-e8f070e8.js:23379:5)
at tryNodeResolve (.../node_modules/vite/dist/node/chunks/dep-e8f070e8.js:23113:20)
at Context.resolveId (.../node_modules/vite/dist/node/chunks/dep-e8f070e8.js:22874:28)
at Object.resolveId (.../node_modules/vite/dist/node/chunks/dep-e8f070e8.js:42847:46)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async .../node_modules/vite/dist/node/chunks/dep-e8f070e8.js:64148:21
at async .../node_modules/vite/dist/node/chunks/dep-e8f070e8.js:23689:34
at async requestCallbacks.on-resolve (.../node_modules/esbuild/lib/main.js:1360:22)
at async handleRequest (.../node_modules/esbuild/lib/main.js:723:13)
This error came from the "onResolve" callback registered here:
node_modules/esbuild/lib/main.js:1279:20:
1279 │ let promise = setup({
╵ ^
at setup (.../node_modules/vite/dist/node/chunks/dep-e8f070e8.js:23669:19)
at handlePlugins (.../esbuild/lib/main.js:1279:21)
at buildOrContextImpl (.../node_modules/esbuild/lib/main.js:968:5)
at Object.buildOrContext (.../node_modules/esbuild/lib/main.js:776:5)
at .../node_modules/esbuild/lib/main.js:2172:68
at new Promise (<anonymous>)
at Object.context (.../node_modules/esbuild/lib/main.js:2172:27)
at Object.context (.../node_modules/esbuild/lib/main.js:2012:58)
at prepareEsbuildOptimizerRun (.../node_modules/vite/dist/node/chunks/dep-e8f070e8.js:44450:35)
The plugin "vite:dep-pre-bundle" was triggered by this import
node_modules/debug/src/common.js:14:32:
14 │ createDebug.humanize = require('ms');
╵
Hi, @evanmartiin
It seems like this issue is coming from vite
and package ms
if I'm not wrong because I tried on my MacOs
and it's working as expected so could you please give it try without vite
and check whether is it working as expected or not ?
If possible could you please share your package.json file with us ? Please try to re-install ms
package by using this command npm install ms
If issue still persists without vite
please share error log to do further investigation on your issue ? Thank you!
This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.
This issue was closed due to lack of activity after being marked stale for past 7 days.
Problems
When installing with pnpm it works, but when installing with npm, I have a dependency tree issue (see Error 1). When building on Netlify, I have a dependency resolve issue (see Error 2).
I'm using only
@mediapipe/pose: ^0.5.1675469404
and@tensorflow-models/pose-detection: ^2.1.0
and I can't build my project.I think the
@tensorflow-models/pose-detection
's peer dependencies needs different versions of@tensorflow/tfjs-core
.Do you know how can I fix that please ? 🙏
System information
Error 1 - npm install on local
Error 2 - npm run build on Netlify