Syntaxerror: unexpected reserved word => prettier/third-party.Js
Tags: javascript, webpack, node, discuss
Published: 2022-04-16 15:22:05

## Overview
This type of error are most likely to occur while working with webpack, prettier plugin, node and framework of JavaScript. There are few hacks to resolve this type of error but before that you need to check few things mentioned in this article.

Webpack is module bundler for frameworks and library of JavaScript which uses plugin called prettier plugin to read all files dependency graph. Whenever file is found with a matching extension, the file is processed by this plugin and overwritten.

## Check version of node
If you encounter with this type of error you need to first check the version of node which you are currently using in your system. To check the version of node you need to run following command in your command prompt:

```
node -v
```
If you have node version 8 or older version than 8, you need to upgrade your node version to node v10 or above to resolve this type of error.

![node-v](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6rg3vmn1glibeth861y9.png)

I’m lucky enough to have node v10.19.0 which is above v8😄

Don’t worry If you don’t want to upgrade you node version. There is an alternative to resolve this error.

If you are free to upgrade node version, download executable file from [here ](https://nodejs.org/en/download/)and install it. Make sure you uninstall previously installed node version before installing new version of node.

## Check version of prettier
Now next thing is to check which version of prettier you are using along with webpack. You can verify it by looking at your _package.json_ at root level of your project directory where you will see the version of this plugin under _devdependencies_. Make sure you are using **webpack of version 4** or above and **Prettier version 1.13.7 or above**. To upgrade your webpack version and Prettier plugin use this command.

```
npm install -D webpack
npm i -D prettier
```
If you don’t want to upgrade your node version due to other dependencies of package and resolve this error, you can downgrade version of prettier to v1.13.7

```
npm i -D prettier@1.13.7
```

## Reason🤔
As described in official documentation [JavaScript ](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of)for await…of statement is available in node version 10 or above. That’s why this type of error might be occur due to your node version.

In **prettier v1.13.7** this type of statement is not there, that’s why this version is compatible with node v8 or below 10.

## Conclusion
There are two ways to fix or resolve this type of error:

- Upgrade node version to v10 or above, or
- Downgrade prettier version to v1.13.7

> Thanks for reading this blog post. Hope it’s been useful for you. Please post comment and your questions in comment box. I would be happy to fix your problems.

If you found this article useful, please share it with your friends and colleagues!❤️

Read more articles on Dev.To ➡️ [Shivam Pawar](https://dev.to/shivampawar)

Follow me on ⤵️
🌐 [LinkedIn](https://www.linkedin.com/in/shivam-prakash-pawar/)
🌐 [Github](https://github.com/shivam-pawar)