You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[@vue/compiler-sfc] <script setup> is still an experimental proposal.
Follow its status at vuejs/rfcs#227.
[@vue/compiler-sfc] When using experimental features,
it is recommended to pin your vue dependencies to exact versions to avoid breakage.
-- getPageProps path=%2F&name=index&client=false
下午4:35:08 [vite] Error when evaluating SSR module /src/components/Header.vue:
/Users/jerry/Desktop/Project/vitesse-ssr-template/node_modules/.pnpm/[email protected][email protected]/node_modules/ant-design-vue/es/index.js:1
import * as components from './components';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at wrapSafe (internal/modules/cjs/loader.js:984:16)
at Module._compile (internal/modules/cjs/loader.js:1032:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
at Module.load (internal/modules/cjs/loader.js:933:32)
at Function.Module._load (internal/modules/cjs/loader.js:774:14)
at Module.require (internal/modules/cjs/loader.js:957:19)
at require (internal/modules/cjs/helpers.js:88:18)
at nodeRequire (/Users/jerry/Desktop/Project/vitesse-ssr-template/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-e9a16784.js:68211:17)
at ssrImport (/Users/jerry/Desktop/Project/vitesse-ssr-template/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-e9a16784.js:68164:20)
at eval (/src/components/Header.vue:3:69)
/Users/jerry/Desktop/Project/vitesse-ssr-template/node_modules/.pnpm/[email protected][email protected]/node_modules/ant-design-vue/es/index.js:1
import * as components from './components';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at wrapSafe (internal/modules/cjs/loader.js:984:16)
at Module._compile (internal/modules/cjs/loader.js:1032:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
at Module.load (internal/modules/cjs/loader.js:933:32)
at Function.Module._load (internal/modules/cjs/loader.js:774:14)
at Module.require (internal/modules/cjs/loader.js:957:19)
at require (internal/modules/cjs/helpers.js:88:18)
at nodeRequire (/Users/jerry/Desktop/Project/vitesse-ssr-template/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-e9a16784.js:68211:17)
at ssrImport (/Users/jerry/Desktop/Project/vitesse-ssr-template/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-e9a16784.js:68164:20)
at eval (/src/components/Header.vue:3:69)
Error: Couldn't resolve component "default" at "/"
at /Users/jerry/Desktop/Project/vitesse-ssr-template/node_modules/.pnpm/[email protected][email protected]/node_modules/vue-router/dist/vue-router.cjs.js:2016:47
下午4:35:08 [vite] Internal server error: Couldn't resolve component "default" at "/"
at /Users/jerry/Desktop/Project/vitesse-ssr-template/node_modules/.pnpm/[email protected][email protected]/node_modules/vue-router/dist/vue-router.cjs.js:2016:47
(node:27390) UnhandledPromiseRejectionWarning: Error: Couldn't resolve component "default" at "/"
at /Users/jerry/Desktop/Project/vitesse-ssr-template/node_modules/.pnpm/[email protected][email protected]/node_modules/vue-router/dist/vue-router.cjs.js:2016:47
(Use node --trace-warnings ... to show where the warning was created)
(node:27390) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)
(node:27390) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
通过vite-ssr引入antdv后报错[服务器渲染]
Error reported after introducing antdv through vite-ssr [server rendering]
Jun 23, 2022
Hello @JerrySir. We totally like your proposal/feedback, welcome to send us a Pull Request for it. Please send your Pull Request to proper branch, fill the Pull Request Template here, provide changelog/TypeScript/documentation/test cases if needed and make sure CI passed, we will review it soon. We appreciate your effort in advance and looking forward to your contribution!
Version
3.2.6
Environment
"vue": "^3.2.37" "vite-ssr": "^0.9.0" "ant-design-vue": "^3.2.7"
Reproduction link
https://github.com/frandiox/vitesse-ssr-template
Steps to reproduce
依次执行:
pnpm i
npm run dev // 此时报错
npm run dev:spa // 正常运行且渲染antdv组件成功
What is expected?
服务器渲染通过
What is actually happening?
报错,补充说明中贴出报错信息
jerry@JerrydeMacBook-Pro vitesse-ssr-template % npm run dev
vite v2.3.3 dev server running at:
-- SSR mode
[@vue/compiler-sfc] <script setup> is still an experimental proposal.
Follow its status at vuejs/rfcs#227.
[@vue/compiler-sfc] When using experimental features,
it is recommended to pin your vue dependencies to exact versions to avoid breakage.
-- getPageProps path=%2F&name=index&client=false
下午4:35:08 [vite] Error when evaluating SSR module /src/components/Header.vue:
/Users/jerry/Desktop/Project/vitesse-ssr-template/node_modules/.pnpm/[email protected][email protected]/node_modules/ant-design-vue/es/index.js:1
import * as components from './components';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at wrapSafe (internal/modules/cjs/loader.js:984:16)
at Module._compile (internal/modules/cjs/loader.js:1032:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
at Module.load (internal/modules/cjs/loader.js:933:32)
at Function.Module._load (internal/modules/cjs/loader.js:774:14)
at Module.require (internal/modules/cjs/loader.js:957:19)
at require (internal/modules/cjs/helpers.js:88:18)
at nodeRequire (/Users/jerry/Desktop/Project/vitesse-ssr-template/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-e9a16784.js:68211:17)
at ssrImport (/Users/jerry/Desktop/Project/vitesse-ssr-template/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-e9a16784.js:68164:20)
at eval (/src/components/Header.vue:3:69)
/Users/jerry/Desktop/Project/vitesse-ssr-template/node_modules/.pnpm/[email protected][email protected]/node_modules/ant-design-vue/es/index.js:1
import * as components from './components';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at wrapSafe (internal/modules/cjs/loader.js:984:16)
at Module._compile (internal/modules/cjs/loader.js:1032:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
at Module.load (internal/modules/cjs/loader.js:933:32)
at Function.Module._load (internal/modules/cjs/loader.js:774:14)
at Module.require (internal/modules/cjs/loader.js:957:19)
at require (internal/modules/cjs/helpers.js:88:18)
at nodeRequire (/Users/jerry/Desktop/Project/vitesse-ssr-template/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-e9a16784.js:68211:17)
at ssrImport (/Users/jerry/Desktop/Project/vitesse-ssr-template/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-e9a16784.js:68164:20)
at eval (/src/components/Header.vue:3:69)
Error: Couldn't resolve component "default" at "/"
at /Users/jerry/Desktop/Project/vitesse-ssr-template/node_modules/.pnpm/[email protected][email protected]/node_modules/vue-router/dist/vue-router.cjs.js:2016:47
下午4:35:08 [vite] Internal server error: Couldn't resolve component "default" at "/"
at /Users/jerry/Desktop/Project/vitesse-ssr-template/node_modules/.pnpm/[email protected][email protected]/node_modules/vue-router/dist/vue-router.cjs.js:2016:47
(node:27390) UnhandledPromiseRejectionWarning: Error: Couldn't resolve component "default" at "/"
at /Users/jerry/Desktop/Project/vitesse-ssr-template/node_modules/.pnpm/[email protected][email protected]/node_modules/vue-router/dist/vue-router.cjs.js:2016:47
(Use
node --trace-warnings ...
to show where the warning was created)(node:27390) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag
--unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)(node:27390) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
The text was updated successfully, but these errors were encountered: