Skip to content

[Bug]: TypeError: Promises are not supported under tools.rspack which contradicts rsbuild documentation #255

@jjoshi-space

Description

@jjoshi-space

Version

System:
    OS: Windows 11 10.0.22631
    CPU: (14) x64 Intel(R) Core(TM) Ultra 7 155U
    Memory: 41.53 GB / 63.52 GB
  Browsers:
    Edge: Chromium (131.0.2903.63)
    Internet Explorer: 11.0.22621.3527
  npmPackages:
    storybook-vue3-rsbuild: ^1.0.1 => 1.0.1

Details

Hello team,
I'm trying to run some async code to build our custom rspackConfig and eventually use mergeConfig
I've followed this documentation, and have come across below issue

TypeError: Promises are not supported
    at .\node_modules\@rsbuild\core\dist\index.cjs:502:52

I cannot use rsbuildFinal to run async code as it throws error upon using Webpack based plugins within rspackConfig, and guides to pass the same into tools: { rspack: () => {} }

Can the team confirm whether we are allowed to use async under tools.rspack as per below documentation
tools.rspack can also be an async function:

Reproduce link

https://codesandbox.io/p/devbox/vs82ny

Reproduce Steps

  1. Checkout the rsbuild.config.mjs file --> tools: rspack async method
  2. Execute npm run storybook
  3. Check the logs displaying TypeError message

Metadata

Metadata

Assignees

No one assigned

    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