0

I want to convert existing vuejs project to nuxt.js project. For this I have created nuxt.js project and moved moved files to nuxt project. I had copied scr/view/layout and paste into layouts folder, vuex store files into store folder. Inside Layouts.vue changed this tag to this . Updated nuxt.config.js file accordingly added styles, modules and plugins. updated all broken paths.

But when we try to npm run dev it gave errors.

Error example

ERROR in ./assets/js/components/cookie.js
Module Error (from ./node_modules/eslint-loader/index.js):
ERROR in ./assets/js/components/cookie.js
Module Error (from ./node_modules/eslint-loader/index.js):
D:\VueJs-Projects\nuxtapp\assets\js\components\cookie.js
  9:29  error  Unnecessary escape character: \.  no-useless-escape
  9:37  error  Unnecessary escape character: \(  no-useless-escape
  9:39  error  Unnecessary escape character: \)  no-useless-escape
  9:41  error  Unnecessary escape character: \[  no-useless-escape
  9:47  error  Unnecessary escape character: \/  no-useless-escape
  9:49  error  Unnecessary escape character: \+  no-useless-escape
✖ 6 problems (6 errors, 0 warnings)
  [1]: https://i.sstatic.net/uCdLe.jpg

You can see detail of errors here.

1

1 Answer 1

0

This is because you’ve chosen to use ESLint in the nuxt app, and the code from your existing app is triggering the ‘no-useless-escape’ error.

If you know the line the error is occurring at (the output gives you this information; looks like line 9 in cookie.js in the components folder is the issue) you can wrap that code inside the following:


/* eslint-disable no-useless-escape */
... 
some code
...
/* eslint-enable no-useless-escape */

However I’d recommend choosing the same linter that you used for your Vue app, otherwise you may encounter other similar errors.

Sign up to request clarification or add additional context in comments.

2 Comments

We are using same versions, still facing issues
Can you share your package.json?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.