ixartz/Next-js-Boilerplate

Type error: The inferred type of 'MainWithHomeLink' cannot be named without a reference to '.pnpm/@storybook+types@7.0.9/node_modules/@storybook/types'. This is likely not portable. A type annotation is necessary.

sumantaparida opened this issue · 5 comments

  • When i build facing this
    Type error: The inferred type of 'MainWithHomeLink' cannot be named without a reference to '.pnpm/@storybook+types@7.0.9/node_modules/@storybook/types'. This is likely not portable. A type annotation is necessary.
ixartz commented

@sumantaparida Could you share more information on how we can reproduce? Because, the error is in folder .pnpm, the project doesn't use pnpm by default. Then, in the screenshot, the command yarn build, it uses yarn.

For your information, the default package manager is npm because it provides the package-lock.json file.

@sumantaparida Could you share more information on how we can reproduce? Because, the error is in folder .pnpm, the project doesn't use pnpm by default. Then, in the screenshot, the command yarn build, it uses yarn.

For your information, the default package manager is npm because it provides the package-lock.json file.

Issues is resolved, Resion behind this is the type of error
export const MainWithHomeLink: Story = {}
try this

ixartz commented

@sumantaparida I don't 100% understand the fix, is it possible to create a PR? So, I can see it in context and I can even merge the PR.

Thanks in advance.

Hi @ixartz
When I clone this and run this cmd
1: yarn install
2: yarn build
then I face this
Screenshot 2023-05-29 at 8 13 02 PM

===
this is the changes

export const MainWithHomeLink: Story = {
  play: async ({ canvasElement }) => {
    const canvas = within(canvasElement);
    const loginButton = await canvas.getByRole('link', {
      name: /Home/i,
    });

    await userEvent.click(loginButton);
  },
} satisfies Story;