Skip to content

application.js is loading twice in Firefox #209

Answered by ElMassimo
rachitpant asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Rachit!

If it only happens in Firefox it might be related to vitejs/vite#5532.

If application.js is being requested twice, it's probably related to the setup.
Check that you are not accidentally injecting vite_javascript_tag several times in different partials/layouts, or look at each request in the inspector to find the initiator in the Network tab.

The warning about a preloaded resource is likely caused by the previous Loading failed warning.
You might want to verify that the CSP settings in Rails are not as strict during development, as that could be blocking the JS from being loaded.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@rachitpant
Comment options

@ElMassimo
Comment options

Answer selected by ElMassimo
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