question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SyntaxError: The requested module 'react' does not provide an export named 'useCallback'

See original GitHub issue

What package within Headless UI are you using?

@headlessui/react

What version of that package are you using?

^1.5.0

What browser are you using?

Firefox 98.0.2

Reproduction URL

https://github.com/soasada/nextjs-tailwindcss-example

Describe your issue

When I literally copy and paste the Popover component in a fresh project with: Next.js 12.1.4, React 18 (and also 17), Typescript 4.6.3, starts failing with the following error:

SyntaxError: The requested module 'react' does not provide an export named 'useCallback'

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
nckhellcommented, Apr 6, 2022

Aha, clear! That did the trick idd, thanks!

0reactions
iancommented, Apr 12, 2022

I am having the same issue deploying to Cloudflare Pages. Downgrading from 1.5.0 -> 1.4.3 fixes the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The requested module 'react' does not provide an export ...
everything is fine but i don't know why this error is come when i reomove headles ui components then working fine but when...
Read more >
module 'react' does not provide an export named 'useRef'
Hi, I recently tried to update to nextjs12 and react18 to see if there would be any problems upgrading and I've run into...
Read more >
How do I fix "the requested module does not provide an export ...
The reason it didn't work is that Vue provides a named export, whereas you are trying to import it as though it had...
Read more >
Requested module does not provide export named 'default'
To solve the error "The requested module does not provide an export named default", use the `default` keyword when exporting a value from...
Read more >
the requested module 'react' does not provide an ... - You.com
The reason it didn't work is that Vue provides a named export, whereas you are trying to import it as though it had...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found