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

Incorrect entry point for cjs #350

Open
Duby-biu opened this issue Jul 1, 2024 · 2 comments
Open

Incorrect entry point for cjs #350

Duby-biu opened this issue Jul 1, 2024 · 2 comments

Comments

@Duby-biu
Copy link

Duby-biu commented Jul 1, 2024

Issue description

The package.json file specifies "type": "module", but entry point uses commonjs (require Syntax).
refer to: https://nodejs.org/api/packages.html#type
This causes errors when you try to test with vitest. You will get "require() of ES Module ... not supported."

Expected Behavior

The package.json should state "type": "commonjs" or change ./dist/tocbot.js file to ./dist/tocbot.cjs

Environment

Library version: v4.28.2

@jcwillox
Copy link

jcwillox commented Jul 1, 2024

Yes still seems to be an issue with 4.28.2, and is related to #340.
I've just had to downgrade to 4.27.16 again.

@tscanlin
Copy link
Owner

tscanlin commented Jul 9, 2024

Hey, sorry for the late reply, I was out of town last week.
Can you help me figure out how to reproduce this issue?
I've tried building a project with the lastest version of vite and adding tocbot to it but I do not see any build errors (yarn create vite my-app --template react). I also will note that I did change the project type from module to commonjs, but maybe I'm missing something else.

A reproduction of this issue would be very helpful.
Thanks!

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

3 participants