Skip to content

[Bug]: TypeError: Cannot set properties of null #2134

@josylad

Description

@josylad

Describe the bug

It starts off fine but when it gets to the point of translating the post, it throws an error.

Reproduction Steps

set ai_similarity_enabled = true
Launch the program (py main.py) and wait.

Expected behavior

run smoothly and make a video

Screenshots

Sorry, something went wrong with this version! Try again, and feel free │
│ to report this issue at GitHub or the Discord community.                │
│ Version: 3.3.0                                                          │
│ Error: Page.evaluate: TypeError: Cannot set properties of null (setting │
│ 'textContent')                                                          │
│     at eval (eval at evaluate (:226:30), <anonymous>:1:101)             │
│     at UtilityScript.evaluate (<anonymous>:233:19)                      │
│     at UtilityScript.<anonymous> (<anonymous>:1:44)                     │
│ Config: {'allow_nsfw': False, 'theme': 'light', 'times_to_run': 1,      │
│ 'opacity': 0.7, 'storymode': False, 'storymodemethod': 1,               │
│ 'storymode_max_length': 1000, 'resolution_w': 1080, 'resolution_h':     │
│ 1920, 'zoom': 1.2, 'channel_name': 'Reddit Tales', 'background':        │
│ {'background_video': 'minecraft', 'background_audio': 'lofi',           │
│ 'background_audio_volume': 0.05, 'enable_extra_audio': False,           │
│ 'background_thumbnail': False, 'background_thumbnail_font_family':      │
│ 'arial', 'background_thumbnail_font_size': 96,                          │
│ 'background_thumbnail_font_color': '255,255,255'}, 'tts':               │
│ {'voice_choice': 'tiktok', 'random_voice': True,                        │
│ 'elevenlabs_voice_name': 'Bella', 'elevenlabs_api_key': 'REDACTED',     │
│ 'aws_polly_voice': 'Matthew', 'streamlabs_polly_voice': 'Matthew',      │
│ 'tiktok_voice': 'en_us_001', 'tiktok_sessionid': 'REDACTED',            │
│ 'python_voice': '1', 'py_voice_num': '2', 'silence_duration': 0.3,      │
│ 'no_emojis': False}}                                                    │
╰─────────────────────────────────────────────────────────────────────────╯
Traceback (most recent call last):
  File "/home/josylad/Documents/Projects/RedditVideoMakerBot/main.py", line 131, in <module>
    raise err
  File "/home/josylad/Documents/Projects/RedditVideoMakerBot/main.py", line 113, in <module>
    run_many(config["settings"]["times_to_run"])
  File "/home/josylad/Documents/Projects/RedditVideoMakerBot/main.py", line 68, in run_many
    main()
  File "/home/josylad/Documents/Projects/RedditVideoMakerBot/main.py", line 52, in main
    get_screenshots_of_reddit_posts(reddit_object, number_of_comments)
  File "/home/josylad/Documents/Projects/RedditVideoMakerBot/video_creation/screenshot_downloader.py", line 165, in get_screenshots_of_reddit_posts
    page.evaluate(
  File "/home/josylad/Documents/Projects/RedditVideoMakerBot/virtual/lib/python3.10/site-packages/playwright/sync_api/_generated.py", line 8183, in evaluate
    self._sync(
  File "/home/josylad/Documents/Projects/RedditVideoMakerBot/virtual/lib/python3.10/site-packages/playwright/_impl/_sync_base.py", line 115, in _sync
    return task.result()
  File "/home/josylad/Documents/Projects/RedditVideoMakerBot/virtual/lib/python3.10/site-packages/playwright/_impl/_page.py", line 435, in evaluate
    return await self._main_frame.evaluate(expression, arg)
  File "/home/josylad/Documents/Projects/RedditVideoMakerBot/virtual/lib/python3.10/site-packages/playwright/_impl/_frame.py", line 278, in evaluate
    await self._channel.send(
  File "/home/josylad/Documents/Projects/RedditVideoMakerBot/virtual/lib/python3.10/site-packages/playwright/_impl/_connection.py", line 59, in send
    return await self._connection.wrap_api_call(
  File "/home/josylad/Documents/Projects/RedditVideoMakerBot/virtual/lib/python3.10/site-packages/playwright/_impl/_connection.py", line 514, in wrap_api_call
    raise rewrite_error(error, f"{parsed_st['apiName']}: {error}") from None
playwright._impl._errors.Error: Page.evaluate: TypeError: Cannot set properties of null (setting 'textContent')
    at eval (eval at evaluate (:226:30), <anonymous>:1:101)
    at UtilityScript.evaluate (<anonymous>:233:19)
    at UtilityScript.<anonymous> (<anonymous>:1:44)

System Information

Operating System : Ubuntu 22.04
Python version : Python 3.10
App version / Branch : 3.3.0

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.

Additional Context

It works if I set:
ai_similarity_enabled = false

Metadata

Metadata

Assignees

No one assigned

    Labels

    Check up neededMight be able to delete this soon check up on it againbugSomething isn't workinghelp wantedExtra attention is neededkeep

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions