question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expose the Vite dev server

See original GitHub issue

Describe the problem

Telefunc cannot be used with SvelteKit because Telefunc needs a reference to the Vite dev server which SvelteKit creates at:https://github.com/sveltejs/kit/blob/cf5d4aa54c3824a93967abe8508931854cd30524/packages/kit/src/core/dev/index.js#L92.

(Telefunc needs the Vite dev server to be able to run vite.ssrLoadModule() in order to import.meta.glob('**/*.telefunc.*').)

Describe the proposed solution

Expose the vite dev server.

For reference this is how Telefunc integrates with vite-plugin-ssr: https://github.com/vikejs/telefunc/blob/ff196287342b4ea3addbc0e0a559eef680f73796/examples/vite-plugin-ssr/server/index.js

Note how the Vite dev server is set to telefuncConfig.viteDevServer here: https://github.com/vikejs/telefunc/blob/ff196287342b4ea3addbc0e0a559eef680f73796/examples/vite-plugin-ssr/server/index.js#L23

@benmccann mentioned that there is PR to make the Vite dev server accessible, any chance to get it merged?

CC @phiberber who is working on a SvelteKit + Telefunc example.

Alternatives considered

No response

Importance

i cannot use SvelteKit without it

Additional Information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dougmoscropcommented, Feb 23, 2022

I would like to run the dev server in-process; I don’t need access to the internals, an opaque function that takes (req, res, next) or Web Fetch versions would be fine. I guess this actually also asks for a programmatic interface to SvelteKit.

0reactions
Rich-Harriscommented, Jul 15, 2022

Going to close this now that we just use a regular Vite config

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to expose 'host' for external device display? #3396 - GitHub
To get the same behaviour as in v2.2, you can use: vite --host. Or set server.host to true in your config. https://vitejs.dev/config/#server-host ...
Read more >
Server Options - Vite
Configure custom proxy rules for the dev server. Expects an object of { key: options } pairs. Any requests that request path starts...
Read more >
Expose local Vite instance to the network - Amit Merchant
Here's what you will see. Vite dev server exposed to the network. As you can tell, Vite now gives you the ability to...
Read more >
@vavite/expose-vite-dev-server - npm package | Snyk
@vavite/expose-vite-dev-server is a Vite plugin for exposing the Vite development server to user code during development. It can be used for accessing Vite ......
Read more >
vavite/expose-vite-dev-server - NPM Package Overview
Vite plugin for exposing Vite's development server to user code. Version: 1.5.1 was published by cyco130. Start using Socket to analyze ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found