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.

Backend integration in development

See original GitHub issue

Clear and concise description of the problem

if I want to use vite with my backend integration, I don’t know if vite client is running and I have to take :

<script type="module" src="http://localhost:3000/@vite/client"></script>
<script type="module" src="http://localhost:3000/main.js"></script>

or if I have to use files from manifest.json :

<link rel="stylesheet" href="/assets/{{ manifest['main.js'].css }}" />
<script type="module" src="/assets/{{ manifest['main.js'].file }}"></script>

As a developer, I think it would be interesting to know if files documented by manifest.json are out of date when I’m running the vite client : http://localhost:3000/@vite/client

Suggested solution

delete the manifest.json when I’m running the vite dev client. so I know that I have to call

<script type="module" src="http://localhost:3000/@vite/client"></script>
<script type="module" src="http://localhost:3000/main.js"></script>

Alternative

update the manifest.json with dev informations when I’m running the vite dev client.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:5
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
RentecTraviscommented, Jan 12, 2022

In my case I would love to use Vite to replace Webpack in our PHP app, for faster build times during development. Right now that’s not an option.

Most pages have their own entrypoints. We scan manifest files generated by Webpack in both development and production mode to render out all the <script> and <link> tags for the current page.

The Alternative option stated above - generating manifest.json when running vite in development mode - would be ideal. This would enable us to use Vite.

0reactions
lhapaipaicommented, Jul 3, 2022

hi @bluwy, my issue was : if you use vite with a backend like Symfony. you use the manifest.json to generate your entrypoints. if your manifest is present, you parse the file to determine the scripts to include. if your manifest is not present, you create a connection with the dev server. but if you run the dev server and your manifest is still present you have no easy way to know that you have to include in your script tag the connection to the dev server.

this issue is solved with https://github.com/lhapaipai/vite-plugin-symfony

Read more comments on GitHub >

github_iconTop Results From Across the Web

Backend Integration - Microservice API Patterns
Integrate the backend of a distributed application with one or more other backends (of the same or other distributed applications) by exposing its...
Read more >
B Front-End and Back-End Integration
Back-End Integration ... In this implementation, users interact with only one application at a time in a manner determined by their user roles.The...
Read more >
Backend Web Development | API Integration | Middleware
Securely authenticating and registering users · Integrating with content streams and feeds · Providing access to payment processing services · Processing and ...
Read more >
A Seven-Step Guide to API-First Integration - InfoQ
Based on the project requirements, the backend development team develops the integration layer exposing the existing systems.
Read more >
What do you mean by 'Integrating with Back-end Services' in ...
It means exactly that. Backend services could be RESTful or other APIs which you can integrate to using standard http / JSON libraries,...
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