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

Vuex state data is not equal to SSR's data #265

Open
akagamina opened this issue Oct 7, 2019 · 1 comment
Open

Vuex state data is not equal to SSR's data #265

akagamina opened this issue Oct 7, 2019 · 1 comment

Comments

@akagamina
Copy link

akagamina commented Oct 7, 2019

I am using SSR on my project with express.js.

When i request with serverPrefetch on server, response return success, and page is load. but at first, data is not correct showing other or old data.

correct data is updated when the component mounts, but the server-side component not matched to correct data

like this. IMAGE

methods:{ getCompanyProf () { registerStoreModule({ module: companyProfileModule, moduleName: 'companyProfile', store: this.$store }) let paramsArr = this.$route.params.id.split('-') let params = { companyProfileParams: { profileId: paramsArr[paramsArr.length - 1], companyId: paramsArr[paramsArr.length - 2], clientType: 'web', hash: this.$route.query.hash ? this.$route.query.hash : null, isShadow: this.$route.query.isShadow ? 1 : 0 }, companyProfileJobsParams: { profileId: paramsArr[paramsArr.length - 1], companyId: paramsArr[paramsArr.length - 2], pageNumber: 1, pageSize: 9 } } this.$store.dispatch(GET_COMPANY_PROFILE, params.companyProfileParams) } }
serverPrefetch () { this.getCompanyProf()},

I think there is nonsense cache but i dont why? Can you help me?

@borodadada
Copy link

borodadada commented Oct 23, 2020

try runInNewContext: true
renderer = createBundleRenderer( serverBundle, { runInNewContext: true, template: fs.readFileSync(templatePath, 'utf-8'), clientManifest } )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants