Skip to content

docs: Using withUt with storybook in next.js #1023

@acharlop

Description

@acharlop

Area of Improvement

Since the plugin uses imports from node:path and node:module storybook webpack doesn't know about these imports so add the following:

// .storybook/main.(j|t)s
webpackFinal: async (config) => {
    // ... any other webpack stuff 
    config.externals = config.externals || {}
    Object.assign(config.externals, {
      'node:path': 'path',
      'node:module': 'module',
    })

    return config
  },

Link to related docs

No response

Additional information

Package versions

@uploadthing/react: ^7.0.3 => 7.0.3
uploadthing: ^7.1.0 => 7.1.0

👨‍👧‍👦 Contributing

  • 🙋‍♂️ Yes, I'd be down to file a PR implementing the suggested changes!

Metadata

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