mlc-ai / mlc-ai/tokenizers-cpp

Fail to import in Node.js

Open
#32 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
512
Forks
132
PR merge metrics
No merged PRs in 30d

Description

It seems that the npm package can not be imported in a Node.js:

import {Tokenizer} from "@mlc-ai/web-tokenizers";
import {Tokenizer} from "@mlc-ai/web-tokenizers";
        ^^^^^^^^^
SyntaxError: The requested module '@mlc-ai/web-tokenizers' does not provide an export named 'Tokenizer'
import Tokenizer from "@mlc-ai/web-tokenizers";
import Tokenizer from "@mlc-ai/web-tokenizers";
       ^^^^^^^^^
SyntaxError: The requested module '@mlc-ai/web-tokenizers' does not provide an export named 'default'

I have no experience with rollup so I can't quite see where went wrong in packaging.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the two import failures shown in the issue with the @mlc-ai/web-tokenizers package, then inspect its Rollup packaging and module entry configuration. Done means the package exposes a documented import that works in Node.js without either export error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js, rollup
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.