What’s new in NuxtJS 2.8
Tags: nuxt
Published: 2019-07-08 20:16:52

---
title: What’s new in NuxtJS 2.8
published: true
tags: nuxtjs
canonical_url: https://blog.logrocket.com/whats-new-in-nuxtjs-2-8/
---

![](https://thepracticaldev.s3.amazonaws.com/i/uk4sqhseugkqhr5bclrb.png)

NuxtJS is one of the fastest growing frameworks for developing VueJS applications. The ability to choose what type of application you can create with it (universal, static generation or single page applications) is one of its unique features.

Since its initial release, it has gathered a lot of attention from the JavaScript community. The VueJS community deeply backs this tool that helps developers build server-side rendered applications using VueJS without in-depth technical know-how. If you look at their [GitHub](https://github.com/nuxt) profile, you will see issues being raised and various pull requests being sent by its community members and users to better improve the framework.

There have been many releases from the core team (you can check out [this article](https://dev.to/bnevilleoneill/what-s-new-in-nuxt-2-7-2ocf-temp-slug-7837441) to see what’s new in v2.7). In this post, I’ll highlight the notable additions to the NuxtJS new release, **NuxtJS 2.8**.

[![](https://i1.wp.com/blog.logrocket.com/wp-content/uploads/2019/06/minimal-rocket-2xA-1.png?fit=1024%2C239&ssl=1)](https://logrocket.com/signup/)

## Improvements

Some improvements have been made to enhance the developer experience when using NuxtJS. Let’s explore some of them.

### SSR (universal rendering) logs grouping

Starting in NuxtJS v2.7, all SSR logs were being reported to your browser console. You no longer had to switch screens. As you can see in the image below the result of all of your logs appear directly in your browser.

![](https://i0.wp.com/user-images.githubusercontent.com/904724/57533442-12acec80-733e-11e9-92e9-950718b198ac.gif?ssl=1)

However, things can get messy when you try to log two or more things at a time as your browser logs will constantly be littered. Starting with NuxtJS v2.8, SSR logs are now grouped to avoid polluting the browser console.

![](https://i2.wp.com/user-images.githubusercontent.com/904724/58566291-a3396700-8230-11e9-9dd6-09c3ff8578d2.gif?ssl=1)

### Code building indicator in the browser

Another exciting feature shipped with NuxtJS v2.8 is an indicator showing you the build status of your new changes right in your browser.

![](https://i1.wp.com/user-images.githubusercontent.com/904724/58547105-129a6100-8207-11e9-9c61-a93956a17727.gif?ssl=1)

This is useful especially when your app takes some time to build. Now, you can quickly see the status in your browser rather than having to switch to your terminal to check.

## Bug fixes

A few bugs have been fixed with the new release. These bugs fixes are geared towards improving developer experience or addressing concerns expressed by the community.

### **Smart reloading**

Listening on a directory without the supported file extensions could be prone to unnecessary reloads due to file changes which are not used directly by NuxtJS. Eg `*.swp`, `*~` or `*.bak` files used by editors. Starting from v2.8, NuxtJS only listens for file changes for supported extensions. So you no longer have to worry when a new file (not being used directly by NuxtJS) is created.

### **Automatic detecting of page directory creation**

Pages are an integral part of universal applications. They allow for different files to be created and automatically routed within the application. This is the default behavior of NuxtJS. However, when pages are created to see them in action you will have to restart your server. In v2.8, you no longer have to do this as NuxtJS now detects when you create a `page/` directory and will reload itself automatically.

### **Simplified mount error logs**

When creating applications, most times errors are bound to occur. Instantly seeing proper error messages when they happen will make the debugging process faster and easier. From Nuxtv2.8, when an error occurs while mounting your app, the error is logged to the console in dev mode so it’s easier to trace.

Before:

![](https://i2.wp.com/user-images.githubusercontent.com/640208/58495799-ac66fd00-8178-11e9-969f-f80dad9a75e3.png?ssl=1)

After:

![](https://i1.wp.com/user-images.githubusercontent.com/640208/58496300-e2f14780-8179-11e9-9923-ebc3b637fb1d.png?ssl=1)

### Improved lazy loaded components

NuxtJS supports lazy loading by default. However, sometimes user edits can change this behavior. E.g If the user overrides `webpack`‘s build options with`splitChunks:{layouts: false, pages: false}` pages will be loaded already on running the app. Even though these components are already loaded in your app, when NuxtJS is done with its resolving process they are still lazy loaded. A change in the new update has addressed this issue. Now the lazy loaded components are smaller and improved.

### **Minified SPA fallback HTML files**

Previously, the HTML for the SPA fallback was not minified after generating the routes, resulting in different files while in SPA mode. Minification helps in reducing the number of files used in an app by trimming and grouping related files together.  

Before:

```jsx
$ find examples/spa/dist/ -name '*.html' -exec md5sum {} \;
853e7d39c6c79431172d11c71115d487  examples/spa/dist/200.html
4014fb429eb22afeb868705a0dd476db  examples/spa/dist/about/index.html
4014fb429eb22afeb868705a0dd476db  examples/spa/dist/index.html
```

After:

```jsx
$ find examples/spa/dist/ -name '*.html' -exec md5sum {} \;
4014fb429eb22afeb868705a0dd476db  examples/spa/dist/200.html
4014fb429eb22afeb868705a0dd476db  examples/spa/dist/about/index.html
4014fb429eb22afeb868705a0dd476db  examples/spa/dist/index.html
```

### **Improved consola**

Consola can add custom styles to your console. However, in previous versions of NuxtJS custom styles were being overridden. This has been fixed in v2.8 as consola has now been made optional.

### **Bundle re-render**

Controlling the scripts loaded by your HTML is a matter of writing `"inject: false"` in the **bundleRenderer** object in your **nuxt.config.js** file **.** However **,** some JavaScript files are still loaded even after changing the option. This issue has been fixed in the new release. So you control 100% of what goes on in your scripts.

### **Safe SSR logs**

While developing with NuxtJS, you may have come across this error in your terminal:

```jsx
 WARN  Cannot stringify a function VueComponent                                                                          
 WARN  Cannot stringify arbitrary non-POJOs VueComponent
```

and in your browser:

```jsx
Maximum call stack size exceeded error
```

It occurs when you try to log a message to your console like this:

```jsx
created() {
  console.log(this.$route)
}
```

Although it doesn’t stop your app from running it is not the intended behavior and makes debugging a pain. Starting from v2.8, NuxtJS now safely formats SSR logs.

![](https://i1.wp.com/user-images.githubusercontent.com/5158436/57982252-ed179580-7a57-11e9-8e78-79535b92ebb6.png?ssl=1)

## Dependency upgrades

- Consola [v2.7.0](https://github.com/nuxt/consola/releases/tag/v2.7.0)
- Connect [v3.7.0](https://github.com/senchalabs/connect/blob/master/HISTORY.md#370--2019-05-17)
- Webpack [v4.32](https://github.com/webpack/webpack/releases/v4.32.0)
- Babel [v7.4.5](https://github.com/babel/babel/releases/tag/v7.4.5)
- Thread-loader [v2.1.2](https://github.com/webpack-contrib/thread-loader/releases)

**M_igration tip_:** You need not change a single line of code in your project for any effects. Everything will be automatically migrated as soon as you upgrade to NuxtJS v2.8.

## Conclusion

In this tutorial, we explored some new features and improvements in NuxtJS v2.8. We also looked at some deprecated features and future warnings. To see a concrete list of all changes and to know more about the new releases be sure to check out the release [page](https://github.com/nuxt/nuxt.js/releases). What is your favorite new feature/API? Share in the comments **!** Happy coding!
* * *
### Plug: [LogRocket](https://logrocket.com/signup/), a DVR for web apps

[![](https://i0.wp.com/storage.googleapis.com/blog-images-backup/1*s_rMyo6NbrAsP-XtvBaXFg.png?zoom=2&resize=610%2C344&ssl=1)](https://logrocket.com/signup/) <figcaption><a rel="noopener noreferrer" data-href="https://logrocket.com/signup/" href="https://logrocket.com/signup/" target="_blank">https://logrocket.com/signup/</a></figcaption>

[LogRocket](https://logrocket.com/signup/) is a frontend logging tool that lets you replay problems as if they happened in your own browser. Instead of guessing why errors happen, or asking users for screenshots and log dumps, LogRocket lets you replay the session to quickly understand what went wrong. It works perfectly with any app, regardless of framework, and has plugins to log additional context from Redux, Vuex, and @ngrx/store.

In addition to logging Redux actions and state, LogRocket records console logs, JavaScript errors, stacktraces, network requests/responses with headers + bodies, browser metadata, and custom logs. It also instruments the DOM to record the HTML and CSS on the page, recreating pixel-perfect videos of even the most complex single-page apps.

[Try it for free](https://logrocket.com/signup/).
* * *
The post [What’s new in NuxtJS 2.8](https://blog.logrocket.com/whats-new-in-nuxtjs-2-8/) appeared first on [LogRocket Blog](https://blog.logrocket.com).