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

2.x Badge error on ssr build debug #4384

Closed
1 task
HadesD opened this issue Jul 18, 2021 · 1 comment
Closed
1 task

2.x Badge error on ssr build debug #4384

HadesD opened this issue Jul 18, 2021 · 1 comment
Labels

Comments

@HadesD
Copy link
Contributor

HadesD commented Jul 18, 2021

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

2.2.2

Environment

Wsl2 ubuntu docker alpine 3.14, vue 3.1.4

Reproduction link

Edit on CodeSandbox

Steps to reproduce

Code:

<a-badge :count="5">
<a-button type="primary" size="large">0 ₫ <ShoppingCartOutlined /></a-button>
</a-badge>

app-server.js

import { createSSRApp } from 'vue';
import { renderToString } from '@vue/server-renderer';
import { createRouter, createMemoryHistory } from 'vue-router';

import routes from './configs/routes';
import MainApp from './layouts/MainApp';
import Antd from 'ant-design-vue';

// Fix requestAnimationFrame is not defined
global.requestAnimationFrame = cb => cb();

const app = createSSRApp(MainApp);

const router = createRouter({
history: createMemoryHistory('/'),
routes,
});

app.use(Antd);
app.use(router);

(async () => {
try {
router.push({path: context.url});
await router.isReady();
dispatch(await renderToString(app));
} catch (e) {
// throw new Error(e);
dispatch(e.stack);
}
})();

Npm run hot watch (debug)

What is expected?

Error fixed

What is actually happening?

Error when run ssr debug:

<div id="app">ReferenceError: status is not defined
at eval (webpack-internal:///./node_modules/ant-design-vue/lib/badge/Badge.js:134:563)
at ComputedRefImpl.reactiveEffect [as effect] (webpack-internal:///./node_modules/@vue/reactivity/dist/reactivity.cjs.js:46:24)
at ComputedRefImpl.get value [as value] (webpack-internal:///./node_modules/@vue/reactivity/dist/reactivity.cjs.js:880:32)
at _default (webpack-internal:///./node_modules/ant-design-vue/lib/badge/Badge.js:216:38)
at eval (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:3781:35)
at renderFnWithContext (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:1116:21)
at Proxy.eval (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:3781:35)
at Proxy.eval (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:2204:85)
at renderComponentRoot (webpack-internal:///./node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:1159:44)
at renderComponentSubTree (webpack-internal:///./node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:256:51)</div>
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant