Giter Club home page Giter Club logo

Comments (9)

bradgarropy avatar bradgarropy commented on May 29, 2024

Woah, good find! I have importHelpers set to true in tsconfig.json but I still had tslib in the devDependencies.

The weird thing is that I can't reproduce this issue. I tried npx create-next-app@latest and was able to run useCountdown with no issues. What are you using to build your site? Do you have a reproduction or GitHub repository I could look at?

from use-countdown.

msopacua avatar msopacua commented on May 29, 2024

Can we re-open this?
The reason this error occurs with vite is formulated here.

Reproduce:

npm create vite@latest tslib-bug -- --template react-swc-ts
cd tslib-bug
npm install
npm add @bradgarropy/use-countdown
# edit src/App.tsx to import and use use-countdown
npm dev

Result:
➜ press h to show help
✘ [ERROR] Could not resolve "tslib"

node_modules/@bradgarropy/use-countdown/dist/index.js:3:22:
  3 │ var tslib_1 = require("tslib");
    ╵                       ~~~~~~~

from use-countdown.

bradgarropy avatar bradgarropy commented on May 29, 2024

Thank you for the reproduction @msopacua! I was able to successfully reproduce, as well as compare the output bundle sizes with and without tslib. As expected, the bundle is smaller with tslib.

Without tslib
package size: 7.4 kB
unpacked size: 25.5 kB

With tslib
package size: 7.2 kB
unpacked size: 24.7 kB

from use-countdown.

bradgarropy avatar bradgarropy commented on May 29, 2024

@all-contributors please add @narthur for bug

from use-countdown.

allcontributors avatar allcontributors commented on May 29, 2024

@bradgarropy

I've put up a pull request to add @narthur! 🎉

from use-countdown.

bradgarropy avatar bradgarropy commented on May 29, 2024

@all-contributors please add @msopacua for bug

from use-countdown.

allcontributors avatar allcontributors commented on May 29, 2024

@bradgarropy

I've put up a pull request to add @msopacua! 🎉

from use-countdown.

bradgarropy avatar bradgarropy commented on May 29, 2024

@all-contributors please add @msopacua for code

from use-countdown.

allcontributors avatar allcontributors commented on May 29, 2024

@bradgarropy

I've put up a pull request to add @msopacua! 🎉

from use-countdown.

Related Issues (9)

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.