Skip to content

[Bug]: Crashes after saving a file in watch mode #8109

@MBearo

Description

@MBearo

System Info

System:
OS: macOS 15.0
CPU: (10) arm64 Apple M1 Max
Memory: 1.36 GB / 64.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.10.0 - ~/.nvm/versions/node/v20.10.0/bin/node
Yarn: 1.22.21 - ~/.nvm/versions/node/v20.10.0/bin/yarn
npm: 10.2.3 - ~/.nvm/versions/node/v20.10.0/bin/npm
pnpm: 8.12.0 - ~/.nvm/versions/node/v20.10.0/bin/pnpm
bun: 1.1.0 - ~/.bun/bin/bun
Browsers:
Chrome: 129.0.6668.100
Edge: 112.0.1722.68
Safari: 18.0
npmPackages:
@rspack/cli: ^1.0.10 => 1.0.10
@rspack/core: ^1.0.10 => 1.0.10

Details

@test/main@0.0.0 watch:rs
rspack --watch

Rspack compiled successfully in 715 ms
[rspack-cli] [Error: × TypeError: Cannot set property errors of #<Compilation> which has only a getter
│ at removeCompilationTSLoaderErrors (/Users/mbear/bearspace/test-sourcemap/packages/main/node_modules/ts-loader/dist/after-compile.js:274:24)
│ at /Users/mbear/bearspace/test-sourcemap/packages/main/node_modules/ts-loader/dist/after-compile.js:29:9
│ at Object.fn (/Users/mbear/bearspace/test-sourcemap/packages/main/node_modules/ts-loader/dist/instances.js:206:13)
│ at next (/Users/mbear/bearspace/test-sourcemap/packages/main/node_modules/@rspack/lite-tapable/dist/index.js:523:25)
│ at AsyncSeriesHook.callAsyncStageRange (/Users/mbear/bearspace/test-sourcemap/packages/main/node_modules/@rspack/lite-tapable/dist/index.js:543:9)
│ at /Users/mbear/bearspace/test-sourcemap/packages/main/node_modules/@rspack/lite-tapable/dist/index.js:86:18
│ at new Promise ()
│ at AsyncSeriesHook.promiseStageRange (/Users/mbear/bearspace/test-sourcemap/packages/main/node_modules/@rspack/lite-tapable/dist/index.js:85:16)
│ at QueriedHook.promise (/Users/mbear/bearspace/test-sourcemap/packages/main/node_modules/@rspack/lite-tapable/dist/index.js:224:26)
│ at /Users/mbear/bearspace/test-sourcemap/packages/main/node_modules/@rspack/core/dist/Compiler.js:676:320

] {
code: 'GenericFailure'
}

In watch mode, an error occurs when modifying any file

Reproduce link

No response

Reproduce Steps

git clone https://github.com/MBearo/issue-rspack-sourcemap-error/tree/ts-loader-watch-error
npm i
npm run watch:rs
modify any file

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