Gatsby: When deploying in gatsby.com it builds in Development Environment

Created on 27 Nov 2019  路  2Comments  路  Source: gatsbyjs/gatsby

Description

Not sure if i should post this because it seems to be a problem with the gatsby.com cloud plataform, not with GatsbyJS itself.

Deploying the app to gatsby.com cloud builds it in development mode, and the service worker does not register.

Building it in production locally works fine.
Deploying on Netlify works fine too.

Steps to reproduce

Repository

Live Demo at gatsby.com (deploys as development environment for unknown reason)

Live Demo at Netlify (works fine)

Building locally: (this works fine too)
clone the repo and run:
npm install (or yarn install)
gatsby build
gatsby serve

Expected result

It should deploy as Production env.

Actual result

It deploys as Development environment, thus making the service worker not register.

Environment

System:
OS: Linux 5.3 Fedora 31 (Workstation Edition) 31 (Workstation Edition)
CPU: (4) x64 AMD A10-7700K Radeon R7, 10 Compute Cores 4C+6G
Shell: 5.0.7 - /bin/bash
Binaries:
Node: 12.13.0 - /usr/bin/node
Yarn: 1.19.1 - /usr/local/bin/yarn
npm: 6.13.1 - /usr/local/bin/npm
Languages:
Python: 3.7.5 - /usr/bin/python
Browsers:
Chrome: 78.0.3904.108
Firefox: 70.0.1
npmPackages:
gatsby: ^2.18.3 => 2.18.4
gatsby-plugin-manifest: ^2.2.30 => 2.2.30
gatsby-plugin-offline: ^3.0.24 => 3.0.24
gatsby-plugin-react-helmet: ^3.1.16 => 3.1.16
npmGlobalPackages:
gatsby-cli: 2.8.13

question or discussion

Most helpful comment

Hi @DouglasMV, actually this is the expected behavior. Gatsby Cloud provides real-time previews that means Gatsby Cloud is like a gatsby develop in the cloud. This is powerful because this way you can edit your code/content and see live previews.

more info: https://www.gatsbyjs.org/blog/2019-11-14-announcing-gatsby-cloud/#features

And Gatsby Cloud Builds are in private beta right now. It will actually deploy a production version of your site.

TL;DR

All 2 comments

Hi @DouglasMV, actually this is the expected behavior. Gatsby Cloud provides real-time previews that means Gatsby Cloud is like a gatsby develop in the cloud. This is powerful because this way you can edit your code/content and see live previews.

more info: https://www.gatsbyjs.org/blog/2019-11-14-announcing-gatsby-cloud/#features

And Gatsby Cloud Builds are in private beta right now. It will actually deploy a production version of your site.

TL;DR

Hi!
If you have questions about Gatsby Cloud please reach out to [email protected]

Furthermore this is expected behavior, Gatsby Preview is not intended for hosting but our cloud builds are. You can find the links above.

Was this page helpful?
0 / 5 - 0 ratings