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

Vue 3.0.11 error with SSR #3660

Closed
theoribeiro opened this issue Apr 23, 2021 · 1 comment
Closed

Vue 3.0.11 error with SSR #3660

theoribeiro opened this issue Apr 23, 2021 · 1 comment

Comments

@theoribeiro
Copy link

Version

3.0.11

Reproduction link

https://github.com/theoribeiro/vue-next-ssr

Steps to reproduce

  1. Run build
    npm install
    npm run build
    
  2. Try to render
    node render.js
    

What is expected?

    <main>
        <h1>App</h1>
        <div>Comp</div>
    </main>

What is actually happening?

    [Vue warn]: resolveComponent can only be used in render() or setup().
    (node:22835) UnhandledPromiseRejectionWarning: TypeError: Cannot create property '__props' on string 'comp'
        at normalizePropsOptions (webpack://app/./node_modules/@vue/runtime-core/dist/runtime-core.cjs.js?:1737:30)
        at createComponentInstance (webpack://app/./node_modules/@vue/runtime-core/dist/runtime-core.cjs.js?:6379:23)
        at renderComponentVNode (webpack://app/./node_modules/@vue/server-renderer/dist/server-renderer.cjs.js?:159:22)
        at ssrRenderComponent (webpack://app/./node_modules/@vue/server-renderer/dist/server-renderer.cjs.js?:484:12)
        at ssrRender (webpack://app/./src/app.vue?./node_modules/vue-loader/dist/templateLoader.js??ruleSet%5B1%5D.rules%5B1%5D!./node_modules/vue-loader/dist/index.js??ruleSet%5B1%5D.rules%5B2%5D.use%5B0%5D:15:81)
        at renderComponentSubTree (/Users/theoribeiro/Dev/playground/vue-next-ssr/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:222:13)
        at renderComponentVNode (/Users/theoribeiro/Dev/playground/vue-next-ssr/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:173:16)
        at renderToString (/Users/theoribeiro/Dev/playground/vue-next-ssr/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js:412:26)
        at Object.<anonymous> (/Users/theoribeiro/Dev/playground/vue-next-ssr/render.js:4:1)
        at Module._compile (internal/modules/cjs/loader.js:1075:30)
    (Use `node --trace-warnings ...` to show where the warning was created)
    (node:22835) 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: 2)
    (node:22835) [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.

This is the same repro with updated dependencies as the one in #2918 that was marked as a duplicate of #2863.

However, #2863, is marked as closed and solved but it does not solve either this issue nor #2918.

@theoribeiro theoribeiro changed the title Vue 3.0.11 error with SFC Vue 3.0.11 error with SSR Apr 23, 2021
@HcySunYang
Copy link
Member

Duplicate of #3393

const nodeExternals = require('webpack-node-externals')
// and
externals: [nodeExternals()],

@github-actions github-actions bot locked and limited conversation to collaborators Oct 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants