Coder Social home page Coder Social logo

Comments (4)

cc-steina avatar cc-steina commented on May 23, 2024 3

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:

ReferenceError: exports is not defined in ES module scope This file is being treated as an ES module because it has a '.js' file extension and 'C:\git\PROJECT_DIRECTORY\node_modules\@tweenjs\tween.js\package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.

from tween.js.

trusktr avatar trusktr commented on May 23, 2024

Thanks @inukshuk and @christjt for pointing these issues out!

from tween.js.

inukshuk avatar inukshuk commented on May 23, 2024

Unfortunately the linked PR above doesn't address this issue. The CJS entry point needs to have a .cjs extension or the Node.js module loader will refuse to open it. The current .cjs.js one doesn't work.

from tween.js.

inukshuk avatar inukshuk commented on May 23, 2024

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).

from tween.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.