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

Slow build and hot reloading #133

Open
ecodoc opened this issue Oct 22, 2021 · 5 comments
Open

Slow build and hot reloading #133

ecodoc opened this issue Oct 22, 2021 · 5 comments

Comments

@ecodoc
Copy link

ecodoc commented Oct 22, 2021

I am an amateur and I don't know any other way to make a comment so I apologize if this is the wrong way to do it.

I realize that I am way behind in this course and a lot has changed. On my iMac running macos Big Sur, the build step for the simplest possible index.js as described in Module 2 Step 4 Pages takes a minimum of 3 - 5 minutes whereas the video makes it seem much faster. Secondly, there is no hot loading and the website does not update until the file is saved in vs code. I have followed all the steps as described in the videos, but maybe I missed something about build speed and hot loading.

@Asjas
Copy link
Contributor

Asjas commented Oct 23, 2021

Hey @ecodoc

the build step for the simplest possible index.js as described in Module 2 Step 4 Pages takes a minimum of 3 - 5 minutes

Yes, that is quite slow. Running a build with npm run build shouldn't take more than a minute at most if you only have a index.js file.

Can you try npm run build on any small Gatsby starter project to see if those build that slow as well? If it also takes a lot of time then it could be your computer that is the issue.

You can download any basic starter here to test https://www.gatsbyjs.com/starters/

the website does not update until the file is saved in vs code

That is the default way to update the page during development, you have to save the code in the file before the website will show what you typed. There is an experimental fast-refresh loader that you can enable by setting this in your .env file, fast-refresh will update the page as you type without you needing to save the file.

I don't know if you have that enabled or not? Wes shows this at some later point in the course. 🙂

GATSBY_HOT_LOADER=fast-refresh

@ecodoc
Copy link
Author

ecodoc commented Oct 24, 2021 via email

@Asjas
Copy link
Contributor

Asjas commented Oct 24, 2021

Was it proper for me to use Git 'issues' or is there preferred way to make comments and ask questions?

It's usually easier and faster to help if you join the Wesbos Slack community, you should have received an email with an invite link when you bought the course. Most of Wes' students are on the Slack community so you'll have many people who will see your questions. 🙂

I have tried everything I could find to make emmet work as the video suggests, but not able to make it work.

Emmet does not work in JavaScript files by default, it something you must enable yourself. These are the settings you have to add to your settings.json file in VS Code.

"emmet.includeLanguages": { 
  "javascript": "javascriptreact", 
}, 
"emmet.triggerExpansionOnTab": true,

@ecodoc
Copy link
Author

ecodoc commented Oct 26, 2021 via email

@Asjas
Copy link
Contributor

Asjas commented Oct 27, 2021

I found the Slack channel with a "Magic" sign in link that is only good for 24 hours. Will I need a password for the Slack channel?

Yes, you would create an account with an email and password to then log in. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants