-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
CJS entry point can't be loaded in Node.js #649
Comments
Is there an alternative on how to add it in nodejs right now? I'm currently trying to add it to a Nextjs Application with typescript and I get this error:
|
Unfortunately the linked PR above doesn't address this issue. The CJS entry point needs to have a |
I submitted a PR for this above. It just renames the CJS entry point (which breaks the naming scheme but I don't think there's a way around making the Node.js loader accept a CJS in an ESM package). |
I might be doing something wrong, but I believe there is an issue with the current dual package setup. Type is set to
module
but the CJS entry pointmain
points to "dist/tween.cjs.js". Despite the.cjs
in there the Node.js loader still sees the final.js
extension. Based on the nearestpackage.json
it will therefore default to using the ESM loader for this file.As a result, you can't currently
require('@tweenjs/tween.js')
in Node. Unless I'm missing something the.js
extension should be dropped.The text was updated successfully, but these errors were encountered: