question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sketch Welcome Screen

See original GitHub issue

Small bug when Sketch “Welcome” screen is shown on app start.

Expected behavior:

Rendering should start normally.

Observed behavior:

  • TypeError: null is not an object (evaluating 'context.document.currentPage')
  • Sketch shows welcome screen, but does not render document

How to reproduce:

Install Sketch and don’t check off “show on every launch” on the “Welcome” screen.

Sketch version:

43.2

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mathieudutourcommented, Apr 16, 2020

I believe you can just do

const sketch = require('sketch');

export default () => {
  const documents = sketch.getDocuments();
  let doc = Array.isArray(documents) && documents.length >= 1 // if there are any open documents
    ? documents[0] // select the last active document
    : new sketch.Document(); // or create a new document

  render(<DocumentContainer colors={theme.colors} />, doc);
  doc.selectedPage = doc.pages[0] // not sure that's necessary?
};
1reaction
jemgoldcommented, Apr 28, 2017

Well that seems like a bigger issue 😃

Can you try this?

  • Open Console.app (find it with Spotlight)
  • in the sidebar, select ~/Library/Logs -> com.bohemiancoding.sketch3 -> Plugin Output.log
  • Close & reopen Sketch
  • open a blank document
  • type npm run render in a terminal
  • are there any errors in your terminal, or in that Console screen?
Read more comments on GitHub >

github_iconTop Results From Across the Web

Sample App Login Screen Sketch Resource
Sketch App free sources, Sample App Login Screen resource, for Sketch App. Sample App Login Screen Sketch file freebie.
Read more >
20 | Welcome Screen | .sketch - Pinterest
Dec 25, 2016 - #20 | Welcome Screen | .sketch designed by Luka Dadiani. Connect with them on Dribbble; the global community for...
Read more >
Sketch - Sign in - It's great to see you again
Sign in to Sketch. Email. PasswordForgot Password? Sign In. Sign in with SSO. New to Sketch? Create an account. Using Sketch with a...
Read more >
Bring back the welcome screen in Sketch App - Stack Overflow
Go the the Menu Window and select Welcome Window. Be sure to check "Show this widow on launch" to see it again every...
Read more >
Welcome Screen Freebie - Sketch Repo
Here's a basic welcome screen that you can use as an inspiration when designing your next mobile app. Well done, Serhiy Semenov!
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found