Skip to content

Commit

Permalink
fix(nitro): use globalThis
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Apr 21, 2021
1 parent 9fd3718 commit 5a0d9e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/rollup/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export const getRollupConfig = (nitroContext: NitroContext) => {
values: {
'process.env.NODE_ENV': nitroContext._nuxt.dev ? '"development"' : '"production"',
'typeof window': '"undefined"',
'global.': 'globalThis.',
'process.env.ROUTER_BASE': JSON.stringify(nitroContext._nuxt.routerBase),
'process.env.PUBLIC_PATH': JSON.stringify(nitroContext._nuxt.publicPath),
'process.env.NUXT_STATIC_BASE': JSON.stringify(nitroContext._nuxt.staticAssets.base),
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/app/vue2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { createRenderer } from '#nitro-vue-renderer'
const _renderer = createRenderer({})

// @ts-ignore
const __VUE_SSR_CONTEXT__ = global.__VUE_SSR_CONTEXT__ = {}
const __VUE_SSR_CONTEXT__ = globalThis.__VUE_SSR_CONTEXT__ = {}

export function renderToString (component, context) {
return new Promise((resolve, reject) => {
Expand Down

0 comments on commit 5a0d9e7

Please sign in to comment.