JesusTheHun / storybook-addon-remix-react-router

Use your app router in your stories. A decorator made for Remix React Router and Storybook
Apache License 2.0
45 stars 11 forks source link

Error after upgrading to storybook 7.1 #42

Closed drewbrend closed 11 months ago

drewbrend commented 11 months ago

I get this error when attempting to upgrade to storybook 7.1.1, my current version which works fine is v7.0.27.

../../node_modules/storybook-addon-react-router-v6/dist/index.d.ts(1,78): error TS2307: Cannot find module '@storybook/preview-api/dist/storybook-channel-mock-a19cd233' or its corresponding type declarations

Looks like this comes from here:

import * as _storybook_preview_api_dist_storybook_channel_mock_a19cd233 from '@storybook/preview-api/dist/storybook-channel-mock-a19cd233';
import React from 'react';
import { RouteObject } from 'react-router';

declare const withRouter: _storybook_preview_api_dist_storybook_channel_mock_a19cd233.M;

Which I think is what this compiles to:

https://github.com/JesusTheHun/storybook-addon-react-router-v6/blob/c7063b8f74f31333310e373cc0ed5a9972344e43/src/features/decorator/withRouter.tsx#L7

I was able to reproduce this with both v2.0.0 and v1.0.2.

JesusTheHun commented 11 months ago

Hi @drewbrend, can you confirm v2.0.1 fixes the issue ?

JesusTheHun commented 11 months ago

I confirmed the fix when I made the release v2.0.1 so I'm closing this without your own validation. Feel free to reopen this if the issue persists.

drewbrend commented 11 months ago

Yup, just verified now and it's fixed. Thanks!