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.

Build output caching does not work for `@nrwl/next:build` followed by `@nrwl/next:dev-server`

See original GitHub issue

Expected Behavior

Running the @nrwl/next:build command should cache build outputs, so that @nrwl/next:dev-server does not need to build the app again.

Current Behavior

yarn nx run myapp:build:production
# observe: myapp is compiled

yarn nx run myapp:serve:production
# observe: myapp is compiled *again*

Failure Information (for bugs)

Steps to Reproduce

https://github.com/Yolk-HQ/nx-caching-issue-2429

Context

Please provide any relevant information about your setup:

  @nrwl/angular : Not Found
  @nrwl/cli : 8.12.2
  @nrwl/cypress : 8.12.2
  @nrwl/eslint-plugin-nx : Not Found
  @nrwl/express : Not Found
  @nrwl/jest : 8.12.2
  @nrwl/linter : 8.12.2
  @nrwl/nest : Not Found
  @nrwl/next : 8.12.2
  @nrwl/node : Not Found
  @nrwl/react : 8.12.2
  @nrwl/schematics : Not Found
  @nrwl/tao : 8.12.2
  @nrwl/web : 8.12.2
  @nrwl/workspace : 8.12.2
  typescript : 3.5.3

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:8

github_iconTop GitHub Comments

1reaction
vsavkincommented, Jul 23, 2020

Hi folks! This example shows a “workaround”: https://github.com/nrwl/nx-incremental-large-repo. Basically, you can only cache files written to disk. The example shows how to build libraries (write files to disk), and webpack (for linking and chunking). The example uses Angular but there is really nothing Angular-specific about it.

This isn’t ideal because relinking everything takes time, and isn’t really needed for development.

My plan is to for very large apps only use webpack for prod builds and have a simple dev server that can load compiled libs, concat them, and serve them. Google does it this way (just with closure instead of webpack).

Does it make sense?

0reactions
vsavkincommented, Aug 13, 2020

Closing this issue.

Making this a better-supported use case is one of the priorities for H2 2020.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Build Cache - Gradle User Manual
The build cache works by storing (locally or remotely) build outputs and allowing builds ... A first feature using the build cache is...
Read more >
Improve page rendering by configuring output caching
Configure page output cache settings at the site level​​ , click Site Settings. Under Site Administration, click Site output cache. Under Anonymous Cache...
Read more >
OutputCache attribute not working on .NET 7 API endpoint
Edit 2: If I move app.UseOutputCache() to the first place in Configure() it works, but the documentation says that it must be placed...
Read more >
How Caching Works - Nx
If Nx doesn't find a corresponding computation hash, Nx runs the task, ... Captures stdout and stderr to make sure the replayed output...
Read more >
Donut Output Caching in ASP.NET MVC 3 - DevTrends
Sounds easy...so what's the problem? Whilst ASP.NET MVC is built on top of the ASP.NET framework, it has some quite significant differences that...
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