Skip to content

[Bug]: Unable to import 'rfc4648' #22542

Closed

Description

Describe the bug

I have a dependency using the "rfc4648" package and none of my stories will work if I have that dependency imported anywhere. I am trying to figure out what about how Storybook is building the project causes that package to not work, but hoping someone more familiar with the build process can help find the problem faster.

The following is the error in the console, but I provided a Stackblitz repro with just one simple Component and Story that reproduces the issue.

TypeError: Cannot read properties of undefined (reading 'base16')
    at ./node_modules/rfc4648/lib/index.mjs (app-example-stories.iframe.bundle.js:256:66)
    at __webpack_require__ (runtime~main.iframe.bundle.js:28:33)
    at fn (runtime~main.iframe.bundle.js:322:25)
    at ./src/app/example.component.ts (app-example-stories.iframe.bundle.js:37:65)
    at __webpack_require__ (runtime~main.iframe.bundle.js:28:33)
    at fn (runtime~main.iframe.bundle.js:322:25)
    at ./src/app/example.stories.ts (app-example-stories.iframe.bundle.js:15:76)
    at __webpack_require__ (runtime~main.iframe.bundle.js:28:33)
    at fn (runtime~main.iframe.bundle.js:322:25)
    at main.iframe.bundle.js:265:10

To Reproduce

https://github.com/Marklb/sb-repro-22542

https://stackblitz.com/edit/github-qjqvmy-hdq5tc?file=src%2Fapp%2Fexample.component.ts,package.json

System

The repro sandbox and Stackblitz uses Storybook `7.0.10`.

Environment Info:

  System:
    OS: Windows 10 10.0.19045
    CPU: (8) x64 Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz
  Binaries:
    Node: 16.19.0 - C:\Program Files\nodejs\node.EXE
    npm: 8.19.3 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (113.0.1774.35), ChromiumDev (115.0.1843.0)
  npmPackages:
    @storybook/addon-essentials: ^7.0.10 => 7.0.11
    @storybook/addon-interactions: ^7.0.10 => 7.0.11
    @storybook/addon-links: ^7.0.10 => 7.0.11
    @storybook/angular: ^7.0.10 => 7.0.11
    @storybook/blocks: ^7.0.10 => 7.0.11
    @storybook/testing-library: ^0.0.14-next.2 => 0.0.14-next.2

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