Fail to import in Node.js

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

Nobody has claimed this yet.

Assessment

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

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.

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.

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

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.

More from mlc-ai/tokenizers-cpp

All issues in mlc-ai/tokenizers-cpp

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.