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

httpDevServer undefined #137

Open
reteps opened this issue Jan 1, 2025 · 0 comments
Open

httpDevServer undefined #137

reteps opened this issue Jan 1, 2025 · 0 comments

Comments

@reteps
Copy link

reteps commented Jan 1, 2025

Same as #8

import { reloader } from '@vavite/reloader';
import { defineConfig } from 'vite';

import { config } from './src/lib/config.js';

export default defineConfig({
  server: {
    port: +config.serverPort,
  },
  plugins: [
    reloader({
      entry: '/src/server',
    }),
  ],
});

Inside server.ts

import httpDevServer from '@vavite/reloader/http-dev-server';
console.log({ httpDevServer });
/* { httpDevServer: undefined } */

Error

error: Error initializing PrairieLearn server: Cannot read properties of undefined (reading 'on') {"stack":"TypeError: Cannot read properties of undefined (reading 'on')\n    at startServer (/Users/retep/repos/PrairieLearn/apps/prairielearn/src/server.ts:1885:35)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async eval (/Users/retep/repos/PrairieLearn/apps/prairielearn/src/server.ts:2238:9)"}
/Users/retep/repos/PrairieLearn/apps/prairielearn/src/server.ts:1885
    __vite_ssr_import_6__.default.on("request", server);
"@vavite/reloader": "^5.1.0",
"vite": "^6.0.6"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant