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

Crashes my app while loading the shards #52

Closed
DustinBrett opened this issue Apr 21, 2023 · 4 comments
Closed

Crashes my app while loading the shards #52

DustinBrett opened this issue Apr 21, 2023 · 4 comments

Comments

@DustinBrett
Copy link
Contributor

I haven't figured out why yet but when I integrate this into my app it crashes while tvmjs is running through getting all the files. I found switching off of dev mode helped but after it loads Webpack stops working.

@DustinBrett
Copy link
Contributor Author

I actually figured this out last night. self = this; at llm_chat.js#L406 was not something Webpack liked. I've changed self back to this and made initProgressCallback an arrow function. Seems to have fixed it.

@DustinBrett
Copy link
Contributor Author

FYI @jinhongyii, I closed this but perhaps others may run into this issue with self = this in the global scope.

@jinhongyii
Copy link
Member

Thanks for finding out the bug. Can you make a pull request so that others will not encounter the same bug again?

@jinhongyii jinhongyii reopened this Apr 22, 2023
@DustinBrett
Copy link
Contributor Author

Thanks for finding out the bug. Can you make a pull request so that others will not encounter the same bug again?

Ya sure I could do that. From a testing pov I only know it worked for me, but hopefully it's a harmless change. Unless self was being used for things I have yet to run into.

jinhongyii pushed a commit that referenced this issue Apr 22, 2023
While integrating this into a Next.js project I noticed that when it
tried to run `self.updateLastMessage` it would crash Webpack in general
and nothing else would load. Converting this to an arrow function to
maintain the existing `this` binding fixed my issue. I'd reported this
in #52.
K-Najwno added a commit to K-Najwno/web-llm that referenced this issue May 13, 2023
While integrating this into a Next.js project I noticed that when it
tried to run `self.updateLastMessage` it would crash Webpack in general
and nothing else would load. Converting this to an arrow function to
maintain the existing `this` binding fixed my issue. I'd reported this
in mlc-ai/web-llm#52.
dragon-rider0111 added a commit to dragon-rider0111/web-llm that referenced this issue May 15, 2023
While integrating this into a Next.js project I noticed that when it
tried to run `self.updateLastMessage` it would crash Webpack in general
and nothing else would load. Converting this to an arrow function to
maintain the existing `this` binding fixed my issue. I'd reported this
in mlc-ai/web-llm#52.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants