Giter Club home page Giter Club logo

Comments (21)

FWeinb avatar FWeinb commented on July 4, 2024

Can you test this with 3.2.0 You should not have .close() it every time. This is definitely not expected behaviour.

from electron-screenshot-service.

peerbolte avatar peerbolte commented on July 4, 2024

Just tried it with 3.2.0, no luck :(. Still getting the errors

from electron-screenshot-service.

FWeinb avatar FWeinb commented on July 4, 2024

I just tested it with the example/multiple.js and everything is working fine. Can you provide a simple example that fails for you?

from electron-screenshot-service.

peerbolte avatar peerbolte commented on July 4, 2024

example/multiple.js runs screenshot.close() after running it? What happens if you omit that?

from electron-screenshot-service.

FWeinb avatar FWeinb commented on July 4, 2024

It runs it after all screenshots where made. Promise.all([]) waits till all the promises are fulfilled.

[Edit]
If it is omitted the process will never stop.

from electron-screenshot-service.

peerbolte avatar peerbolte commented on July 4, 2024

There are three iframes on the page I am trying to capture. When I visit a page without iframes, the error does not occur. Could this be the possible source for the problem?

from electron-screenshot-service.

FWeinb avatar FWeinb commented on July 4, 2024

Thanks for the hint. I will try with multiple iframe!

from electron-screenshot-service.

FWeinb avatar FWeinb commented on July 4, 2024

I can't reproduce it here. I tried with multiple screenshot of the front page of codepen.io where 6 iframes are loaded each time and everything is working fine.

from electron-screenshot-service.

peerbolte avatar peerbolte commented on July 4, 2024

did you omit screenshot.close() ? In my case I want to keep the process open, as I send multiple domains to process over time.

from electron-screenshot-service.

FWeinb avatar FWeinb commented on July 4, 2024

Here is the code I am using.

from electron-screenshot-service.

peerbolte avatar peerbolte commented on July 4, 2024

gives a 404

from electron-screenshot-service.

FWeinb avatar FWeinb commented on July 4, 2024

Sorry, should work now.

from electron-screenshot-service.

peerbolte avatar peerbolte commented on July 4, 2024

hi, this code gives me the error. It's not consistent, you might need to run it a couple of times.

It might have something to do with the load of the websites in the iframes?
Or does this occur because screenshot.close() is never called?

from electron-screenshot-service.

FWeinb avatar FWeinb commented on July 4, 2024

When you run cat node_modules/electron-prebuilt/dist/version in the root of your project dose this print v1.2.6?

from electron-screenshot-service.

peerbolte avatar peerbolte commented on July 4, 2024

yes

from electron-screenshot-service.

FWeinb avatar FWeinb commented on July 4, 2024

This is a hard one... I can't reproduce it on my side.

from electron-screenshot-service.

peerbolte avatar peerbolte commented on July 4, 2024

Really appreciate the help. I understand it's tricky to debug this way. The complete error:

Uncaught Exception:
TypeError: Cannot read property 'id' of null
    at Timeout.makeScreenshot (<PATH>/node_modules/electron-screenshot-service/electron-service/node_modules/electron-screenshot-app/index.js:61:42)
    at tryOnTimeout (timers.js:224:11)
    at Timer.listOnTimeout (timers.js:198:5)
    at listOnTimeoutNT (timers.js:242:26)
    at _combinedTickCallback (internal/process/next_tick.js:71:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

from electron-screenshot-service.

FWeinb avatar FWeinb commented on July 4, 2024

Just tried using Network Link Conditioner to throttle my connection to 3G but it still worked. There seams to be a race condition in the iframe detection code.

[Edit]
Could you test inserting:

if (popupWindow === null) return;

in line 60 of index.js

from electron-screenshot-service.

peerbolte avatar peerbolte commented on July 4, 2024

I'm still getting an error when inserting the code:
I really don't understand, shouldn't the return prohibit the code from executing?

Uncaught Exception:
TypeError: Cannot read property 'capturePage' of null
    at Timeout.setTimeout (<PATH>/node_modules/electron-screenshot-service/electron-service/node_modules/electron-screenshot-app/index.js:85:17)
    at tryOnTimeout (timers.js:224:11)
    at Timer.listOnTimeout (timers.js:198:5)

[Edit]
What version of node are you on? I'm at 5.2.0

[Edit2]
It does seem to suppress some errors, however in my other code visiting example.com triggers the error mentioned above

[Edit3]
I have suppressed all remaining errors by adding your suggestion at line 60 and 81

 if (popupWindow === null) return;

Everything seems to be working fine for now. Thank you so much for thinking along!

from electron-screenshot-service.

peerbolte avatar peerbolte commented on July 4, 2024

Are the if (popupWindow === null) return;solutions at line 60 and 81 valid enough to implement? As I think this solves the issue.

from electron-screenshot-service.

FWeinb avatar FWeinb commented on July 4, 2024

Added in [email protected]

from electron-screenshot-service.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.