#Storybook won't build after upgrading Mantine 7, cites missing useId and useSyncExternalStore

6 messages · Page 1 of 1 (latest)

compact fable
#

After upgrading to Mantine v7, our Storybook will no longer build. The build fails with the following errors:

✘ [ERROR] No matching export in "global-externals:react" for import "useId"

    node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/@mantine/core/esm/core/Box/use-random-classname/use-random-classname.mjs:2:9:
      2 │ import { useId } from 'react';
        ╵          ~~~~~

✘ [ERROR] No matching export in "global-externals:react" for import "useId"

    node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/@mantine/core/esm/components/Combobox/ComboboxOption/ComboboxOption.mjs:2:16:
      2 │ import React, { useId } from 'react';
        ╵                 ~~~~~

✘ [ERROR] No matching export in "global-externals:react" for import "useSyncExternalStore"

    node_modules/.pnpm/@[email protected][email protected]/node_modules/@mantine/store/esm/store.mjs:2:9:
      2 │ import { useSyncExternalStore } from 'react';
        ╵          ~~~~~~~~~~~~~~~~~~~~

Error: Build failed with 3 errors:
node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/@mantine/core/esm/components/Combobox/ComboboxOption/ComboboxOption.mjs:2:16: ERROR: No matching export in "global-externals:react" for import "useId"
node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/@mantine/core/esm/core/Box/use-random-classname/use-random-classname.mjs:2:9: ERROR: No matching export in "global-externals:react" for import "useId"
node_modules/.pnpm/@[email protected][email protected]/node_modules/@mantine/store/esm/store.mjs:2:9: ERROR: No matching export in "global-externals:react" for import "useSyncExternalStore"

I've tried replacing our preview.tsx with the example here: https://v7.mantine.dev/guides/storybook#storybook-preview but no luck.

React components and hooks library with native dark theme support and focus on usability, accessibility and developer experience

earnest wigeon
compact fable
#

We're using 18...

#

Have also done a pnpm why react to check we don't have any 16/17 versions hanging around and it's 18.2.0 all the way

earnest wigeon
compact fable
#

Hmm, I found this issue https://github.com/storybookjs/storybook/issues/20378 and this linked PR https://github.com/storybookjs/storybook/pull/24514 but these are both talking about the manager UI (rather than the preview UI where Mantine components would be rendered in our stories)

GitHub

Is your feature request related to a problem? Please describe Storybook's own "manager UI" is currently using React 16, which is not the latest. Describe the solution you'd like W...

GitHub

Replaces: #21673
Closes #20378 #22217
What i did:
Upgrade react and some testing deps then fix the fallout.
Checklist

Make sure your changes are tested (stories and/or unit, integration, or end-...