Skip to content

Circular Reference Issue with Main JS Script #19126

Answered by hi-ogawa
spillz asked this question in Q&A
Discussion options

You must be logged in to vote

It looks like the issue doesn't happen when src="/main.js":

- <script type="module" src="main.js"></script>
+ <script type="module" src="/main.js"></script>

With this, Vite rewrites html properly after main.js changes like below, so there's no duplicate modules after reload.

<script type="module" src="/vite-test/main.js?t=1735877176556"></script>

I think this is a bug as Vite should support script's src uniformly regardless of relative or absolute path. Please feel to submit an issue.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@spillz
Comment options

Answer selected by spillz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants