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.

It's possible to produce a "successful" build that yields no JS bundle or HTML

See original GitHub issue

Are you reporting a bug?

Yes. It’s possible to produce a “successful” build that yields no JS bundle or HTML. I stumbled across this issue when one of my data API end-point was unavailable.

Environment

  1. react-static -V: 6.1.4
  2. node -v: 8.9.0
  3. npm -v: 5.5.1
  4. Operating system: Mac OS
  5. Browser and version (if relevant): N/A

Steps to Reproduce the problem

  1. Run react-static create and select the basic template
  2. Edit static.config to return an empty array from getRoutes
  3. Delete src/pages
  4. Run yarn build
  5. Observe that, despite a console warning of no “index” page, build is successful, and that dist contains just react-static-browser-plugins.js
  6. Edit static.confg and throw an error from getRoutes
  7. Run yarn build
  8. Observe that build is successful, and that dist contains just react-static-browser-plugins.js

Expected Behavior

Because there are no “page” routes or routes returned by getRoutes, yarn build should fail with exit code 1 in both cases. Previous in v5, when I threw an error caused by an unavailable end-point the build would fail. The current v6 behaviour can result in a CI tool such as Netlify deploying the minimal dist directory

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
tannerlinsleycommented, Apr 1, 2019

v7 uses a whole new flow for CLI commands and should no longer swallow errors. If you still run into this error in the new version, please reopen this issue!

Thanks for your feedback on this as always.

0reactions
tannerlinsleycommented, Feb 8, 2019

After a passthrough of this logical tree and some debugging, I couldn’t find where the error’s are getting swallowed. I’m going to do another run-through later this week.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack-dev-server not bundling even after showing bundle ...
The project seems to be working fine with just webpack cmd. It builds into my build folder and I can get it working...
Read more >
How to Bundle a Simple Static Site Using Webpack - SitePoint
The first thing you'll need is to have Node and npm installed on your ... And webpack will create a bundle.js file in...
Read more >
Comparing the New Generation of Build Tools - CSS-Tricks
Using the “minify” and “bundle” options in your esbuild command won't create a bundle quite as small as a Rollup/Terser pipeline. This is ......
Read more >
Production - Parcel
Parcel's production mode automatically bundles and optimizes your application for production. It can be run using the parcel build command:
Read more >
Slimming down your bundle size - LogRocket Blog
Separating JavaScript assets into separate files does require a lot of HTTP requests when different parts of the application require different ...
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