Skip to content

Svelte 5: console.log is not a function in $effect #16170

Closed as not planned
Closed as not planned
@UltraCakeBakery

Description

@UltraCakeBakery

Describe the bug

While trying to make a bug report for a reactivity issue I've encountered, I've somehow caused console.log to no longer be a function inside my $effect?

I'm not sure how, or why this happens.

If I move the console.log on line 12 outside the if block, it works fine.

This now prevents me from debugging the reactivity bug I have, making svelte unusable.

Reproduction

https://svelte.dev/playground/bb84e50796d841149df7c33b9e8e7a26?version=latest#H4sIAAAAAAAACp1U22rbQBD9lcmSBi0Y20ne5AuYNG1KSQMmJZSqD2tpZA_d7IrdsR1X6N-LrMqSHLeBsgjEmXPmcjSrXBj1jCIUd6i1ha11OoEAE2JMpOiJlDR6EX7PBe-yklcColerZlnW9xvUXGIL5fEUHlvDaNiLUIx97CjjaWQi1sjglEnsM0zg3LNiDO4Vr_oVGEg5qmllBkUG3RMlvGroQ_mKcYe0XPFJijIb5W81PqNpESQMBvD-6_39N_jwMIf57c38dvb46eFLrcvohWZZBhMwa63hX_TyOcc0xZiDQMJkCvkeZkohOOs0IMEhr50ZQWRanD_FZC2MrfFWY1_bZXA0Yw-ury5lRYs4UH5nYuhULU_TfV6M6lLlUVtFDB1Z0NJFvCHchl3Xeu24Q0-_8NEecfqZcmi4VpR2fcYdpNaBQ59Z42mDBr0_aydbqPjn0tm1SWY6W6kQhp1ayjApTcqHwG6NTaiQMpCduUobj_ZlCkO4uHi1I1MYSuiMnDi1_egoqVIe4JS0LuEn4tV8v5w3VlvnO7Sifi3kAS8AtUf435baH__y6rqpdqLPN3vc91fUXqVrEzNZA02quu7hTnYu4159pP17zcMMb2ccD5p_ghkntAHPO42TSDQ7ETpMRrAtnQvhcjh8N4oELMgkIa_IT_LOAhZVJNaEhvduT_Ku-x1G5XyLUgHFNK8aLcaDhDZT0ROMLyzCcv-KHz3BivSWTCLCVGmPxW9oulgMSgUAAA==

Logs

TypeError
TypeError: console.log(...) is not a function
    at $effect (playground:output:3403:76)
    at update_reaction (playground:output:2204:57)
    at update_effect (playground:output:2371:19)
    at flush_queued_effects (playground:output:2479:6)
    at flush_queued_root_effects (playground:output:2451:6)
TypeError
TypeError: console.log(...) is not a function
    at $effect (playground:output:3403:76)
    at update_reaction (playground:output:2204:57)
    at update_effect (playground:output:2371:19)
    at flush_queued_effects (playground:output:2479:6)
    at flush_queued_root_effects (playground:output:2451:6)

System Info

https://svelte.dev/ chrome

Severity

blocking all usage of svelte

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions