Skip to content

[Bug]: loaderContext.import module with inline loader causes rust panic #9931

@dtothefp

Description

@dtothefp

System Info

System: Apple M3 Max Sequoia 15.3.2
Binaries: binding-darwin-arm64
NPM: @rspack/(core|cli) 1.3.2

Details

This looks related to #8536 and seems to be fixed in https://github.com/web-infra-dev/rspack/pull/8590/files but maybe this issue is related to using the inline loader syntax .

When using loaderContext.importModule with an inline loader a rust panic occurs that is not caught by the callback / returned promise.

Panic occurred at runtime. Please file an issue on GitHub with the backtrace below: https://github.com/web-infra-dev/rspack/issues
Message:  should have module
Location: crates/rspack_core/src/compiler/module_executor/execute.rs:80

Backtrace omitted.

Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

Reproduce link

rstackjs/rspack-repro@main...dtothefp:rspack-repro:dfp-loader-context-import-module

Reproduce Steps

In the repo above run pnpm install && pnpm run build

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions