-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
unstable_middleware not working with the Cloudflare template #13181
Comments
I'm having a similar issue where I'm getting message: "Cannot read properties of undefined (reading 'unstable_middleware')", |
This looks like a a duplicate module issue - maybe from a CJS/ESM boundary or something? If I More details - |
I think that relates to my reported bug. #13158 You should pass the context instead of the contextprovider to the requesthandler as second parameter. The types do not match the implementation. |
#13158 is just a types issue - not a runtime issue. This issue is due to duplicate modules being loaded in the module graph based on how Vite and the Cloudflare plugin work. |
Jacob just published this PR to my repro repo, which seems to fix the issue. alexanderson1993/cloudflare-middleware#1 |
I'm using React Router as a...
framework
Reproduction
Clone https://github.com/alexanderson1993/cloudflare-middleware
Install dependencies
Run
npm run dev
Open in a browser
System Info
Used Package Manager
npm
Expected Behavior
It should display the default React Router template welcome page
Actual Behavior
It throws
Error: No value found for context
Note: I have also tried this with the latest version of Vite and it still failed.
The text was updated successfully, but these errors were encountered: