-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
MultipartReader fails with UnexpectedEof if using --no-check or compille #9620
Comments
It seems that after running with test file: import { MultipartReader } from "https://deno.land/[email protected]/mime/multipart.ts";
import { StringReader } from "https://deno.land/[email protected]/io/readers.ts";
// carriage returns added for running on POSIX, not needed if on windows
const content = `--------------------------366796e1c748a2fb\r
Content-Disposition: form-data; name="payload"\r
Content-Type: text/plain\r
\r
CONTENT\r
--------------------------366796e1c748a2fb--`
const boundary = "------------------------366796e1c748a2fb";
const stringReader = new StringReader(content);
const multipartReader = new MultipartReader(stringReader, boundary);
const formData = await multipartReader.readForm()
for (const entry of formData.entries()) {
console.log("entry", entry);
}
console.log("formdata", formData); output:
|
cc/ @kdy1 I haven't narrowed it down yet, but it looks like there is some problem with the output of transpiling. |
swc_ecma_parser: - Fix lexing of template literals. (denoland/deno#9620) - Ensure that denoland/deno#9650 is not a bug of parser.
I recognise this error, it's what lead me to track down and open swc-project/swc#930. In other words this is #9773 seen in https://github.com/denoland/deno_std/blob/0.90.0/mime/multipart.ts#L264-L269. It will also be fixed by #9774, once we adapt that code to the additional |
Fixed by denoland/std#807. |
While this seems to have fixed the
But running with --no-check passes now so that's good:
|
@vinc3m1 For tracking purposes, can you open a separate issue for that? |
Fixed in 1.9.0 |
Same issue as #7932, not sure why the author closed that bug.
I first found this only happening when I compiled my script to a binary (
compile --unstable
).Then, after finding #7932, I tested
--no-check
and it results in the same error.Code works just fine with regular
deno run
[email protected]
deno 1.7.5
The text was updated successfully, but these errors were encountered: