Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Module '"vite"' has no exported member 'createServer'. #17739

Closed
7 tasks done
nicodel opened this issue Jul 22, 2024 · 0 comments
Closed
7 tasks done

Module '"vite"' has no exported member 'createServer'. #17739

nicodel opened this issue Jul 22, 2024 · 0 comments

Comments

@nicodel
Copy link

nicodel commented Jul 22, 2024

Describe the bug

I am trying to setup Vite + Vue.js in SSR mode. I am following the docs Vite - Server-Side Rendering .
But when I adapt to the my contexte, and rename the server.js to server.ts, I get the error from logs below.

Reproduction

https://gitlab.com/nicodel/countdowns/-/tree/v2?ref_type=heads

Steps to reproduce

Run yarn install, then yarn start.

System Info

System:
    OS: Linux 6.1 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
    CPU: (12) x64 Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
    Memory: 4.45 GB / 15.30 GB
    Container: Yes
    Shell: 5.2.15 - /bin/bash
  Binaries:
    Node: 20.15.1 - /usr/bin/node
    Yarn: 1.22.22 - /usr/bin/yarn
    npm: 10.7.0 - /usr/bin/npm
  Browsers:
    Chromium: 126.0.6478.182
  npmPackages:
    @vitejs/plugin-vue: ^5.0.5 => 5.0.5 
    vite: ^5.3.4 => 5.3.4

Used Package Manager

yarn

Logs

Click to expand!
yarn run v1.22.22
$ ts-node -r tsconfig-paths/register bin/www
/home/nicodel/dev/countdowns/node_modules/ts-node/src/index.ts:859
    return new TSError(diagnosticText, diagnosticCodes, diagnostics);
           ^
TSError: ⨯ Unable to compile TypeScript:
src/server.ts:9:10 - error TS2305: Module '"vite"' has no exported member 'createServer'.

9 import { createServer } from 'vite';
           ~~~~~~~~~~~~

    at createTSError (/home/nicodel/dev/countdowns/node_modules/ts-node/src/index.ts:859:12)
    at reportTSError (/home/nicodel/dev/countdowns/node_modules/ts-node/src/index.ts:863:19)
    at getOutput (/home/nicodel/dev/countdowns/node_modules/ts-node/src/index.ts:1077:36)
    at Object.compile (/home/nicodel/dev/countdowns/node_modules/ts-node/src/index.ts:1433:41)
    at Module.m._compile (/home/nicodel/dev/countdowns/node_modules/ts-node/src/index.ts:1617:30)
    at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
    at Object.require.extensions.<computed> [as .ts] (/home/nicodel/dev/countdowns/node_modules/ts-node/src/index.ts:1621:12)
    at Module.load (node:internal/modules/cjs/loader:1208:32)
    at Function.Module._load (node:internal/modules/cjs/loader:1024:12)
    at Module.require (node:internal/modules/cjs/loader:1233:19) {
  diagnosticCodes: [ 2305 ]
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Validations

@vitejs vitejs locked and limited conversation to collaborators Jul 23, 2024
@bluwy bluwy converted this issue into discussion #17741 Jul 23, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

1 participant