-
-
Notifications
You must be signed in to change notification settings - Fork 587
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]: Strange HMR bug after removing <style>
in Vue SFC
#7805
Comments
<style>
in Vue SFC
i cant reproduce with rspack. |
I reproduce with the following rspack config: const rspack = require('@rspack/core');
const { VueLoaderPlugin } = require('vue-loader');
/** @type {import('@rspack/cli').Configuration} */
const config = {
entry: './src/index.js',
plugins: [
new VueLoaderPlugin(),
new rspack.HtmlRspackPlugin({}),
new rspack.CssExtractRspackPlugin({
runtime: false,
}),
],
// experiments: {
// css: true,
// },
module: {
rules: [
{
test: /\.css$/i,
use: [
{ loader: rspack.CssExtractRspackPlugin.loader, options: {} },
'css-loader',
],
type: 'javascript/auto',
},
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
// Note, for the majority of features to be available, make sure this option is `true`
experimentalInlineMatchResource: true,
},
},
],
},
};
module.exports = config; My guess about the process: |
this should be fixed in #7878 and released in 1.0.5, @CPunisher can you help verify it |
@ZhangTaibin please try 1.0.5 |
It's done when use When use But it's not done when i delete System: Windows 11 |
+1. It can also be reproduced in the rsbuild example. https://github.com/web-infra-dev/rsbuild/tree/main/examples/vue |
This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment! |
Let's say module A imports module B by one of A's loaders with
I come up with 3 solutions:
|
Version
Details
i just create a pure project with
pnpm create rsbuild@latest
.And then run the project with
pnpm run dev
. it's ok and i dont edit anything.when i delete
<style></style
element inApp.vue
. It will throw an error writting "Cannot read properties of undefined (reading 'call')". Then i stop the HMR and run the project again. It will be OK.I think that it has some strange problem with HMR
Reproduce link
not link
Reproduce Steps
pnpm create rsbuild@latest
cd project
pnpm i
pnpm run dev
delete style element in
App.vue
The text was updated successfully, but these errors were encountered: