Skip to content

Commit

Permalink
fix(gatsby): encode window.pagePath to get valid JS code (#36349)
Browse files Browse the repository at this point in the history
  • Loading branch information
Leksat authored Apr 28, 2023
1 parent 3b31e35 commit 6feee5d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/gatsby/cache-dir/static-entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,9 @@ export default async function staticPage({
})

// Add page metadata for the current page
const windowPageData = `/*<![CDATA[*/window.pagePath="${pagePath}";${
const windowPageData = `/*<![CDATA[*/window.pagePath=${JSON.stringify(
pagePath
)};${
process.env.GATSBY_SLICES
? ``
: `window.___webpackCompilationHash="${webpackCompilationHash}";`
Expand Down

0 comments on commit 6feee5d

Please sign in to comment.