"TypeError: dispatcher.useInsertionEffect is not a function" after upgrading from ^5.3.3 to ^5.4.0

See original GitHub issue

What package has an issue

@mantine/core

Describe the bug

I am using mantine version ^5.3.3 with next.js 13.0.1.

When I upgrade to a newer mantine version, e.g. ^5.4.0 or ^5.7.0 I get the following error when opening my website:

error - TypeError: dispatcher.useInsertionEffect is not a function
    at useInsertionEffect (C:\pathToMyProject\node_modules\react\cjs\react.development.js:1638:21)
    at useEvent (C:\pathToMyProject\node_modules\@floating-ui\react-dom-interactions\dist\floating-ui.react-dom-interactions.umd.js:186:7)
    at Object.useFloating (C:\pathToMyProject\node_modules\@floating-ui\react-dom-interactions\dist\floating-ui.react-dom-interactions.umd.js:223:26)
    at Object.usePopover (C:\pathToMyProject\node_modules\@mantine\core\cjs\Popover\use-popover.js:45:41)
    at Popover (C:\pathToMyProject\node_modules\@mantine\core\cjs\Popover\Popover.js:134:30)   
    at renderWithHooks (C:\pathToMyProject\node_modules\react-ssr-prepass\dist\react-ssr-prepass.js:454:15)
    at render$2 (C:\pathToMyProject\node_modules\react-ssr-prepass\dist\react-ssr-prepass.js:465:6)
    at C:\pathToMyProject\node_modules\react-ssr-prepass\dist\react-ssr-prepass.js:612:12      
    at render (C:\pathToMyProject\node_modules\react-ssr-prepass\dist\react-ssr-prepass.js:613:4)
    at visitElement (C:\pathToMyProject\node_modules\react-ssr-prepass\dist\react-ssr-prepass.js:725:15) {
  page: '/webinars/[id]'
}

Thanks for this awesome library and taking the time to read this issue 😃

What version of @mantine/hooks page do you have in package.json?

^5.4.0

If possible, please include a link to a codesandbox with the reproduced problem

No response

Do you know how to fix the issue

No

Are you willing to participate in fixing this issue and create a pull request with the fix

No

Possible fix

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
quick0831commented, Nov 5, 2022

I found a same error Just running next dev cause me this

@mantine/core version: ^5.6.3

error - TypeError: dispatcher.useInsertionEffect is not a function
    at useInsertionEffect (C:\pathToMyProject\node_modules\react\cjs\react.development.js:1638:21)
    at useEvent (C:\pathToMyProject\node_modules\@floating-ui\react-dom-interactions\dist\floating-ui.react-dom-interactions.umd.js:186:7)
    at Object.useFloating (C:\pathToMyProject\node_modules\@floating-ui\react-dom-interactions\dist\floating-ui.react-dom-interactions.umd.js:223:26)
    at Object.useTooltip (C:\pathToMyProject\node_modules\@mantine\core\cjs\Tooltip\use-tooltip.js:34:28)
    at C:\pathToMyProject\node_modules\@mantine\core\cjs\Tooltip\Tooltip.js:143:30
    at renderWithHooks (C:\pathToMyProject\node_modules\react-ssr-prepass\dist\react-ssr-prepass.js:454:15)
    at render$2 (C:\pathToMyProject\node_modules\react-ssr-prepass\dist\react-ssr-prepass.js:465:6)
    at C:\pathToMyProject\node_modules\react-ssr-prepass\dist\react-ssr-prepass.js:612:12
    at render (C:\pathToMyProject\node_modules\react-ssr-prepass\dist\react-ssr-prepass.js:613:4)
    at visitElement (C:\pathToMyProject\node_modules\react-ssr-prepass\dist\react-ssr-prepass.js:725:15) {
  page: '/'
}
0reactions
quick0831commented, Nov 29, 2022

Actually I forgot it. I remember turning off ssr in trpc and it stop complaining.

Read more comments on GitHub >

github_iconTop Results From Across the Web

react select error on upgrade: TypeError: dispatcher ...
I have just updated the react-select library and I have found out that It doesn't work anymore.
Read more >
TypeError: dispatcher.useSyncExternalStore is not a function
Hi all, I think I'm going crazy, because I've been trying to debug this issue with the apollo client for ~an hour, and...
Read more >
TypeError: dispatcher.useInsertionEffect is not a function-Reactjs
Coding example for the question react select error on upgrade: TypeError: dispatcher.useInsertionEffect is not a function-Reactjs.
Read more >
Uncaught TypeError: dispatcher.useInsertionEffect is not a ...
I tried installing storybook, did npx story book init after that I did npm run story book, It opened the browser with a...
Read more >
Uncaught TypeError: dispatch is not a function : r/reactjs - Reddit
You are setting it as a tuple/array on the context provider, so when you read it from context you should use the array...
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