Skip to content

Production build with storybook-rsbuild fails v1.0.1-rc.3 due to source map construction error(?) #83

@cmdcolin

Description

@cmdcolin

I tried building a storybook with the newly released v1.0.1 and it crashes with

$ storybook build
storybook v8.2.9

info => Cleaning outputDir: storybook-static
info => Loading presets
info => Building manager..
info => Manager built (101 ms)
info => Building preview..
info Addon-docs: using MDX3
info => Copying static files: public at storybook-static
● web ━━━━━━━━━━━━━━━━━━━━━━━━━ (70%) sealing asset processing                                        Panic occurred at runtime. Please file an issue on GitHub with the backtrace below: https://github.com/web-infra-dev/rspack/issues
Message:  called `Option::unwrap()` on a `None` value
Location: index.crates.io-6f17d22bba15001f/rspack_sources-0.3.0/src/helpers.rs:838

Backtrace omitted.

Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
Aborted (core dumped)
error Command failed with exit code 134.

the RUST_BACKTRACE didn't have any extra info but i looked at https://github.com/web-infra-dev/rspack-sources/blob/main/src/helpers.rs#L838C26-L842C43 and saw it was related to source mapping so i added

  rsbuildFinal: config => {
    config.output ||= {}
    config.output.assetPrefix = './'
    delete config.output.sourceMap
    return config
  },

and it worked. i like source maps but didn't strictly need them so this was fine. potentially we do some weird things in our repo, and it is open source and i can link it if interested

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions