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

console.log()' output gets truncated and "NULL" substrings are replaced with "[object Object]" #7728

Open
mitya33 opened this issue Jan 10, 2025 · 1 comment
Labels
bug Something that isn't working needs reproduction Needs reproduction from OP

Comments

@mitya33
Copy link

mitya33 commented Jan 10, 2025

Which Cloudflare product(s) does this pertain to?

Workers Runtime, Wrangler

What versions are you using?

3.99.0

What operating system and version are you using?

Windows 10

Please provide a link to a minimal reproduction

No response

Describe the Bug

Wrangler (or possibly the Workers runtime) truncates console.log() output and appends and inserts random instances of [object Object] where the logged string contains the substring "NULL".

For example, if I do this:

console.log(`SELECT
    test.id AS test_id,
    test.name AS test_name,
    test.project_id AS test_project_id,
    test.is_complex AS test_is_complex,
    test.fail_acknowledged AS test_fail_acknowledged,
    test.content AS test_content,
    project.id AS project_id,
    project.name AS project_name
FROM tests AS test
LEFT JOIN test_runs test_run ON test_run.test_id = test.id
JOIN projects project ON test.project_id = project.id
WHERE (test_run.created_at<= '2025-01-10 13:05:45' OR test_run.created_at IS NULL)
GROUP BY test.id,test_run.id,project.id,project.name
ORDER BY test_run.created_at asc NULLS FIRST`);

What I actually get is shown in this image:

bug

See how output is truncated, and two [object Object]s have appeared.) I've found the only way around this is to log output URL encoded.

Please provide any relevant error logs

No response

@mitya33 mitya33 added the bug Something that isn't working label Jan 10, 2025
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Jan 10, 2025
@mitya33 mitya33 changed the title 🐛 BUG: console.log()' texts gets truncated and "NULL" substrings are replaced with "[object Object]" Jan 10, 2025
@mitya33 mitya33 changed the title console.log()' texts gets truncated and "NULL" substrings are replaced with "[object Object]" console.log()' output gets truncated and "NULL" substrings are replaced with "[object Object]" Jan 10, 2025
@penalosa
Copy link
Contributor

I can't seem to reproduce this—could you include a link to a reproduction? I get the output logging just fine:

SELECT
                        test.id AS test_id,
                        test.name AS test_name,
                        test.project_id AS test_project_id,
                        test.is_complex AS test_is_complex,
                        test.fail_acknowledged AS test_fail_acknowledged,
                        test.content AS test_content,
                        project.id AS project_id,
                        project.name AS project_name
                FROM tests AS test
                LEFT JOIN test_runs test_run ON test_run.test_id = test.id
                JOIN projects project ON test.project_id = project.id
                WHERE (test_run.created_at<= '2025-01-10 13:05:45' OR test_run.created_at IS NULL)
                GROUP BY test.id,test_run.id,project.id,project.name
                ORDER BY test_run.created_at asc NULLS FIRST

@penalosa penalosa added the needs reproduction Needs reproduction from OP label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working needs reproduction Needs reproduction from OP
Projects
Status: Untriaged
Development

No branches or pull requests

2 participants