Replies: 1 comment
-
Tried doing |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What package within Headless UI are you using?
@headless/react
What version of that package are you using?
1.4.1 (latest commit)
Describe your issue
There seems to be an intermittent issue with Terser that prevents it from properly understanding the optional chaining operator (
?.
), causing it to emit useless error messages like these:My first attempt at figuring out what was going on was to search keywords on GitHub. It appears that Terser versions before 5.2.0 do not support optional chaining. Taking a look at the
node_modules/terser/package.json
file to see which version was installed for headlessui, I see 5.5.1 was installed in thepackages/@headlessui-react/node_modules
folder, but 4.8.0 was installed in the rootnode_modules
folder.Manually copying Terser 5.5.1 into the root
node_modules
folder causes this error:so clearly something depends on Terser 4, which doesn't support optional chaining, and breaks when Terser 5 is introduced in its place. But that can't be the issue, because headlessui is on NPM and you have working CI.
So, I searched the exact error message and found these:
GMOD/jbrowse-components#1377 - seems to say it appears randomly whenever it feels like
developit/microbundle#522 - headlessui doesn't use microbundle, but same error
https://www.npmjs.com/package/neoy-ui - not very useful, but some random chinese text that includes the error
The only real lead I have right now is that this is allegedly a weird, random issue that affects people for absolutely no reason and goes away on its own.
Beta Was this translation helpful? Give feedback.
All reactions