From 0.16.8 to 0.16.9 : ReferenceError: require is not defined
See original GitHub issueHi there,
I was using twind for quite some time on my project : https://github.com/Shuunen/what-now/
I’m using twind/shim
for months without any issues via this 2 lines of code :
import { setup } from 'twind/shim'`
setup({ mode: 'silent' })
My project is in TypeScript, I build a iife package for web with tsup/esbuild.
Until recently, everything was working well, but the lastest upgrade from 0.16.8
to 0.16.9
has bring this error ReferenceError: require is not defined
on my website.
If I rollback twind to 0.16.8
then build & deploy again : it works as expected, no more error
I looked at https://github.com/tw-in-js/twind/compare/v0.16.8...v0.16.9 , but it’s hard to see which commit introduced this, maybe the chore: deps upgrade
a501131
?
If we compare the 2 builds : 0.16.8 on the left & 0.16.9 on the right :
We can see that require("url")
is appearing with the update, there are 2 other occurences of this same require on the build.
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (1 by maintainers)
Top GitHub Comments
No worries. Happy to help.
@sastan thanks for all your explanations, I learnt a lot today, sorry that the issue belong to tsup in the end (see my previous comment)