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

@vitejs/plugin-react can't detect preamble #119

Closed
paveu opened this issue Jan 21, 2024 · 5 comments · Fixed by #120
Closed

@vitejs/plugin-react can't detect preamble #119

paveu opened this issue Jan 21, 2024 · 5 comments · Fixed by #120

Comments

@paveu
Copy link

paveu commented Jan 21, 2024

does anyone encounter follwing error while running vite dev mode through django-vite

Uncaught Error: @vitejs/plugin-react can't detect preamble. Something is wrong

I'm not sure if it's related to the django-vite package i think it's not, but maybe someone seen it in the past

@MrBin99
Copy link
Owner

MrBin99 commented Jan 22, 2024

I think you did not inject React specific JS in the page to enable HMR, please check :

@paveu
Copy link
Author

paveu commented Jan 22, 2024

@MrBin99 thanks, it was fixed by applying snippet from #89 , django-csp was blocking @vitejs/plugin-react to start up. Can we merge #94 i think it would resolve my problem, i could just pass request.csp_nonce as a kwarg

@MrBin99
Copy link
Owner

MrBin99 commented Jan 22, 2024

This PR has conflicts that need to be resolved before merging.

@Niicck
Copy link
Collaborator

Niicck commented Jan 22, 2024

I'm working on updating that PR 👍

@Niicck
Copy link
Collaborator

Niicck commented Jan 22, 2024

This has been added to v3.0.3

@Niicck Niicck closed this as completed Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants