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

resolvedUrls is null in plugin's configureServer #15438

Closed
7 tasks done
yuan116 opened this issue Dec 27, 2023 · 2 comments · Fixed by #15450
Closed
7 tasks done

resolvedUrls is null in plugin's configureServer #15438

yuan116 opened this issue Dec 27, 2023 · 2 comments · Fixed by #15450
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@yuan116
Copy link

yuan116 commented Dec 27, 2023

Describe the bug

Hi, I am developing a plugin for my own use
and found out the resolvedUrls is still null in plugin's configureServer after server restarted, but the printrUrls working fine

Environment:
node: v21.2.0
npm: 9.5.0

this is the little hack that I use to retrieve after server listen
Screenshot 2023-12-06 at 17 29 00

before server restart
Screenshot 2023-12-06 at 17 35 39

after server restart
Screenshot 2023-12-06 at 17 35 54

Reproduction

https://stackblitz.com/edit/vitejs-vite-5chbdo?file=custom-vite-plugin.js

Steps to reproduce

  1. npm run dev
  2. randomly edit the custom-vite-plugins.js, wait for server restart
  3. after server restarted, resolvedUrls is null

System Info

System:
  OS: Linux 5.0 undefined
  CPU: (6) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  Memory: 0 Bytes / 0 Bytes
  Shell: 1.0 - /bin/jsh
Binaries:
  Node: 18.18.0 - /usr/local/bin/node
  Yarn: 1.22.19 - /usr/local/bin/yarn
  npm: 9.4.2 - /usr/local/bin/npm
  pnpm: 8.10.5 - /usr/local/bin/pnpm
npmPackages:
  vite: ^5.0.8 => 5.0.10

Used Package Manager

pnpm

Logs

No response

Validations

Copy link

stackblitz bot commented Dec 27, 2023

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@XiSenao
Copy link
Collaborator

XiSenao commented Dec 28, 2023

It seems that the front and back server instances are inconsistent.

const newServer = { name: 'newServer' };
await configureServerhook(newServer);
const server = { name: 'server' };
Object.assign(server, newServer); // server !== newServer
server.resolvedUrls = {}; 

This looks like a problem.

@bluwy bluwy added p3-minor-bug An edge case that only affects very specific usage (priority) and removed pending triage labels Jan 8, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jan 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants