Skip to content

Commit d565323

Browse files
author
yuuangzhang
committed
test: update
1 parent 48e8b77 commit d565323

File tree

5 files changed

+3578
-4146
lines changed

5 files changed

+3578
-4146
lines changed

packages/playground/ssr-vue/__tests__/ssr-vue.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import fetch from 'node-fetch'
44

55
const url = `http://localhost:${port}`
66

7-
test('/store', async () => {
7+
test('vuex can be import succeed by named import', async () => {
88
await page.goto(url + '/store')
99
expect(await page.textContent('h1')).toMatch('bar')
1010

1111
// raw http request
12-
const storeHtml = await (await fetch(url + '/env')).text()
12+
const storeHtml = await (await fetch(url + '/store')).text()
1313
expect(storeHtml).toMatch('bar')
1414
})
1515

packages/playground/ssr-vue/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ async function createServer(
6565
template = indexProd
6666
render = require('./dist/server/entry-server.js').render
6767
}
68-
68+
6969
const [appHtml, preloadLinks] = await render(url, manifest, __dirname)
7070

7171
const html = template

packages/playground/ssr-vue/src/pages/Home.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import foo from '@foo'
1818
import { reactive, defineAsyncComponent } from 'vue'
1919
const ImportType = load('ImportType')
20-
2120
const Foo = defineAsyncComponent(() =>
2221
import('../components/Foo').then((mod) => mod.Foo)
2322
)

packages/vite/src/node/ssr/ssrModuleLoader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ function proxyESM(id: string, mod: any) {
212212
return new Proxy(mod, {
213213
get(mod, prop) {
214214
if (prop === 'default') return defaultExport
215-
return mod[prop] ?? defaultExport[prop]
215+
return mod[prop] ?? defaultExport?.[prop]
216216
}
217217
})
218218
}

0 commit comments

Comments
 (0)