Skip to content

[Bug]: Unable to display emails as stories using react-email #26615

Closed

Description

Describe the bug

An error is thrown when trying to display an email using the react-email 2.1.0 library and Storybook 8.0.3 in a Vite standalone project.

TypeError: Cannot read properties of undefined (reading 'prototype')
    at _inheritsLoose (http://localhost:6006/node_modules/.cache/storybook/1c3385a5d25e538d10b518b310c74d3ca2690b6aaffeadccd74da79736171f86/sb-vite/deps/chunk-ESNLZ3U4.js?v=995809a4:5361:57)
    at http://localhost:6006/node_modules/.cache/storybook/1c3385a5d25e538d10b518b310c74d3ca2690b6aaffeadccd74da79736171f86/sb-vite/deps/chunk-ESNLZ3U4.js?v=995809a4:5366:11
    at http://localhost:6006/node_modules/.cache/storybook/1c3385a5d25e538d10b518b310c74d3ca2690b6aaffeadccd74da79736171f86/sb-vite/deps/chunk-ESNLZ3U4.js?v=995809a4:5385:10
    at node_modules/react-dom/cjs/react-dom-server-legacy.node.development.js (http://localhost:6006/node_modules/.cache/storybook/1c3385a5d25e538d10b518b310c74d3ca2690b6aaffeadccd74da79736171f86/sb-vite/deps/chunk-ESNLZ3U4.js?v=995809a4:5419:9)
    at __require2 (http://localhost:6006/node_modules/.cache/storybook/1c3385a5d25e538d10b518b310c74d3ca2690b6aaffeadccd74da79736171f86/sb-vite/deps/chunk-ZSRNYESD.js?v=995809a4:19:50)
    at node_modules/react-dom/server.node.js (http://localhost:6006/node_modules/.cache/storybook/1c3385a5d25e538d10b518b310c74d3ca2690b6aaffeadccd74da79736171f86/sb-vite/deps/chunk-ESNLZ3U4.js?v=995809a4:12074:11)
    at __require2 (http://localhost:6006/node_modules/.cache/storybook/1c3385a5d25e538d10b518b310c74d3ca2690b6aaffeadccd74da79736171f86/sb-vite/deps/chunk-ZSRNYESD.js?v=995809a4:19:50)
    at node_modules/react-dom/server.js (http://localhost:6006/node_modules/.cache/storybook/1c3385a5d25e538d10b518b310c74d3ca2690b6aaffeadccd74da79736171f86/sb-vite/deps/chunk-ESNLZ3U4.js?v=995809a4:12089:22)
    at __require2 (http://localhost:6006/node_modules/.cache/storybook/1c3385a5d25e538d10b518b310c74d3ca2690b6aaffeadccd74da79736171f86/sb-vite/deps/chunk-ZSRNYESD.js?v=995809a4:19:50)
    at http://localhost:6006/node_modules/.cache/storybook/1c3385a5d25e538d10b518b310c74d3ca2690b6aaffeadccd74da79736171f86/sb-vite/deps/@react-email_components.js?v=995809a4:27056:30

image

It works using SB7 but seems like breaking on SB8

To Reproduce

Simple vite 5 + react 18 + typescript 5 project
Storybook 8
react-email 2.1.0

System

Storybook Environment Info:

  System:
    OS: macOS 14.3.1
    CPU: (8) arm64 Apple M1 Pro
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.0 - ~/.nvm/versions/node/v20.11.0/bin/node
    Yarn: 3.5.0 - ~/.nvm/versions/node/v20.11.0/bin/yarn
    npm: 10.2.4 - ~/.nvm/versions/node/v20.11.0/bin/npm <----- active
    pnpm: 8.11.0 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 123.0.6312.58
    Safari: 17.3.1
  npmPackages:
    @storybook/addon-essentials: ^8.0.3 => 8.0.3 
    @storybook/addon-interactions: ^8.0.3 => 8.0.3 
    @storybook/addon-links: ^8.0.3 => 8.0.3 
    @storybook/addon-onboarding: ^8.0.3 => 8.0.3 
    @storybook/blocks: ^8.0.3 => 8.0.3 
    @storybook/react: ^8.0.3 => 8.0.3 
    @storybook/react-vite: ^8.0.3 => 8.0.3 
    @storybook/test: ^8.0.3 => 8.0.3 
    eslint-plugin-storybook: ^0.8.0 => 0.8.0 
    storybook: ^8.0.3 => 8.0.3

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions