Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
MBearo opened this issue Oct 14, 2024 · 3 comments · May be fixed by #8115
Open

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

MBearo opened this issue Oct 14, 2024 · 3 comments · May be fixed by #8115
Labels
bug Something isn't working

Comments

@MBearo
Copy link
Contributor

MBearo commented Oct 14, 2024

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/[email protected] 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

@MBearo MBearo added bug Something isn't working pending triage The issue/PR is currently untouched. labels Oct 14, 2024
@MBearo
Copy link
Contributor Author

MBearo commented Oct 14, 2024

packages/rspack/src/Compilation.ts

There is no implemented 'set' method for errors. Is it intended to be immutable?

@inottn
Copy link
Contributor

inottn commented Oct 14, 2024

Based on the current implementation, it seems that setters can be supported. I will give it a try.

@inottn inottn linked a pull request Oct 14, 2024 that will close this issue
2 tasks
@GiveMe-A-Name GiveMe-A-Name removed the pending triage The issue/PR is currently untouched. label Oct 15, 2024
@LingyuCoder
Copy link
Collaborator

It is not recommended to set compilation.errors directly. This will cause the errors originally generated during the compilation to be lost. You can add new errors through the errors.push method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants