Closed domchristie closed 2 years ago
Hello @domchristie ! Thanks for the pull request, and sorry for the very slow answer ! Instead of adding a new dependency, I think it would be way simpler to replace
process.nextTick(function() { self._tick() })
WIth
process.setTimeout(function() { self._tick() }, 0)
Would you mind modifying your pull request to do this instead (no need for a require
call either then ;) ) ?
or just
setTimeout(function() { self._tick() }, 0)
?
uuuh yes ... sorry, I was not thinking straight :sweat_smile:
@sebpiq no problem! I've amended the commit, so I think this should be good to go :)
@domchristie merged ! Thanks again :)
I'm currently using WAAClock on a Svelte project using Vite. Vite performs some clever CommonJS resolution, but throws when trying to access
process.nextTick
. After a bit of research, it appears thatprocess
can be required~, which is what this PR does!(I think this is what browserify adds to the built file, but given that Vite appears to be using the source files, this needs to be manually included.)~
Edit: this PR replaces
process.nextTick
withsetTimeout
as discussed below.