frandiox / vite-ssr

Use Vite for server side rendering in Node
MIT License
823 stars 91 forks source link

SyntaxError: import not found: useContext #171

Open mrweiner opened 2 years ago

mrweiner commented 2 years ago

The readme and a handful of issues describe using import { useContext } from 'vite-ssr' to access the context, but doing that seems to throw SyntaxError: import not found: useContext. Is there a replacement that exists for this?

It looks like entry-server.js mentions // This can be injected with useSSRContext() in setup functions, but I don't think that that is exactly a replacement for this AFAICT.