Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Objectron javascript library doesn't work after building the app #4086

Closed
geeekgod opened this issue Feb 11, 2023 · 9 comments
Closed

Objectron javascript library doesn't work after building the app #4086

geeekgod opened this issue Feb 11, 2023 · 9 comments
Assignees
Labels
legacy:objectron Objectron related issues platform:javascript MediaPipe Javascript issues type:bug Bug in the Source Code of MediaPipe Solution

Comments

@geeekgod
Copy link

Have I written custom code (as opposed to using a stock example script provided in MediaPipe)

None

OS Platform and Distribution

WSL Ubuntu 20.04.5

Mobile device if the issue happens on mobile device

No response

Browser and version if the issue happens on browser

Google Chrome 109.0.5414.120

Programming Language and version

JavaScript

MediaPipe version

No response

Bazel version

No response

Solution

Objectron

Android Studio, NDK, SDK versions (if issue is related to building in Android environment)

No response

Xcode & Tulsi version (if issue is related to building for iOS)

No response

Describe the actual behavior

Objectron is able to initialize in development but doesn't work after building the javascript application.

Describe the expected behaviour

Objectron should initialize in development and work after building the javascript application.

Standalone code/steps you may have used to try to get what you need

I'm using @mediapipe/objectron javascript package in my ViteJS application using ReactJS as template.
You can find a reproducible repository here: https://github.com/thisisrishabh22/mediapipe-threejs

Steps to reproduce:
1. Clone the repository
2. Install packages using: yarn install
3. Run in the development environment using: yarn dev
4. Create a production build using: yarn build
5. Run in the production environment using: yarn preview

Other info / Complete Logs

Unexpected Application Error!
sl.Objectron is not a constructor

Vg/<@http://localhost:4173/assets/index-d3345c5a.js:84:17875
Xl@http://localhost:4173/assets/index-d3345c5a.js:40:24263
Kr@http://localhost:4173/assets/index-d3345c5a.js:40:42317
iy@http://localhost:4173/assets/index-d3345c5a.js:40:41163
tr@http://localhost:4173/assets/index-d3345c5a.js:40:40212
Wf@http://localhost:4173/assets/index-d3345c5a.js:40:36824
Xn@http://localhost:4173/assets/index-d3345c5a.js:38:3274
dt/<@http://localhost:4173/assets/index-d3345c5a.js:40:34207
@geeekgod geeekgod added the type:bug Bug in the Source Code of MediaPipe Solution label Feb 11, 2023
@geeekgod geeekgod changed the title Mediapipe objectron javascript library doesn't work after building the app Objectron javascript library doesn't work after building the app Feb 11, 2023
@ayushgdev ayushgdev added platform:javascript MediaPipe Javascript issues legacy:objectron Objectron related issues labels Feb 13, 2023
@ayushgdev
Copy link
Contributor

Hello @thisisrishabh22
Thanks for raising this issue. We are aware of the issue and working on a solution.
This seems to be happening due to the Rollup CommonJS plugin, since this plugin can't work with obfuscated packages and the JS source code for MediaPipe is not public. Rollup uses static analysis to determine its exports.

We are working on a solution to unveal the JS code. Meanwhile, can you refer to this workaround and let us know if this works for you?
PS: The link by the author has changed to this link

@ayushgdev ayushgdev added the stat:awaiting response Waiting for user response label Feb 13, 2023
@google-ml-butler
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.

@geeekgod
Copy link
Author

Hi @ayushgdev
I've referred to the workaround you've shared and tried to implement it in my application but it's actually not working.
Thanks

@google-ml-butler
Copy link

Closing as stale. Please reopen if you'd like to work on this further.

@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

@ayushgdev ayushgdev removed stat:awaiting response Waiting for user response stale labels Mar 1, 2023
@ayushgdev ayushgdev reopened this Mar 1, 2023
@ayushgdev
Copy link
Contributor

Hello @thisisrishabh22
We are refreshing our solutions into new Tasks API. They should not have this issue, as they are built using ESM. However, they are not mature enough to be used in production yet, but you can explore the new APIs here

Due to our existing infrastructure, it is difficult for us to release the existing libraries using ESM.

@ayushgdev ayushgdev added the stat:awaiting response Waiting for user response label Mar 1, 2023
@google-ml-butler
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.

@google-ml-butler
Copy link

Closing as stale. Please reopen if you'd like to work on this further.

@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

@ayushgdev ayushgdev removed stat:awaiting response Waiting for user response stalled labels Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy:objectron Objectron related issues platform:javascript MediaPipe Javascript issues type:bug Bug in the Source Code of MediaPipe Solution
Projects
None yet
Development

No branches or pull requests

2 participants