web-llm icon indicating copy to clipboard operation
web-llm copied to clipboard

[Tracking] WebLLM: Frontend Compatibility Issues and CDN Delivery

Open CharlieFRuan opened this issue 1 year ago • 0 comments

This issue tracks the resolution to various front-end compatibility issues.

Action items

  • [ ] Address require() issues
  • [ ] Address perf_hooks import issue
  • [ ] Add CDN delivery

require() issue in next projects

This file is being treated as an ES module because it has a '.js' file extension and '\web-llm\examples\next-simple-chat\node_modules\@mlc-ai\web-llm\package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.

This error has been reported in various issues:

  • https://github.com/mlc-ai/web-llm/issues/140
  • https://github.com/mlc-ai/web-llm/issues/353
    • The error in this issue for some reason stems from web-tokenizer rather than web-llm (though the _scriptDir part is indeed from web-tokenizer)
  • https://github.com/mlc-ai/web-llm/issues/383

Revisit after the following PR is merged and npm is updated, should be able to resolve all issues above:

  • https://github.com/mlc-ai/web-llm/pull/397

perf_hooks issue

This error is reported in issues:

  • https://github.com/mlc-ai/web-llm/issues/127
  • https://github.com/mlc-ai/web-llm/issues/258

CharlieFRuan avatar May 14 '24 08:05 CharlieFRuan