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

fix(vue-renderer): decode route path for payload.js #9494

Merged
merged 2 commits into from Jun 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/vue-renderer/src/renderers/ssr.js
Expand Up @@ -4,7 +4,7 @@ import { format } from 'util'
import fs from 'fs-extra'
import consola from 'consola'
import { TARGETS, urlJoin } from '@nuxt/utils'
import { parsePath, withoutTrailingSlash } from 'ufo'
import { decode, parsePath, withoutTrailingSlash } from 'ufo'
import devalue from '@nuxt/devalue'
import { createBundleRenderer } from 'vue-server-renderer'
import BaseRenderer from './base'
Expand Down Expand Up @@ -210,7 +210,7 @@ export default class SSRRenderer extends BaseRenderer {
// Page level payload.js (async loaded for CSR)
const payloadPath = urlJoin(url, 'payload.js')
const payloadUrl = urlJoin(staticAssetsBase, payloadPath)
const routePath = withoutTrailingSlash(parsePath(url).pathname)
const routePath = withoutTrailingSlash(decode(parsePath(url).pathname))
const payloadScript = `__NUXT_JSONP__("${routePath}", ${devalue({ data, fetch, mutations })});`
staticAssets.push({ path: payloadPath, src: payloadScript })
preloadScripts.push(payloadUrl)
Expand Down