-
Notifications
You must be signed in to change notification settings - Fork 204
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
Non response instances are a valid return #60
Comments
Hey! 👋 Are you saying you were able to return an instance of the |
No I just returned template literal with that library which is why I referenced it, and an error should’ve been thrown because it would in production. |
Ok, I agree there should definitely be an error thrown if the returned response is not a import { html } from "@worker-tools/html";
addEventListener("fetch", e => {
e.respondWith(html`<h1>test</h1>`);
});
Is this what you're doing/seeing? |
I was using worktop so maybe that automatically wraps things in a response, so I simply wasn't able to use the html because there wasn't a content type or something. I suppose that even in miniflare basically trying to send a string along won't a work if it's not instantiated. |
I forgot to put my html within a response body using class exported by https://github.com/worker-tools/html and no errors were thrown if you make the request with something like hotwired stimulus.
The text was updated successfully, but these errors were encountered: