A
A
Andrej Sharapov2019-06-20 17:15:56
JavaScript
Andrej Sharapov, 2019-06-20 17:15:56

How to get around the syntax error?

Hi friends!
The third day I'm learning to work with vue.js.
For reference: I work in VSCode and build a project in gulp. (the assembled project is here ).
I've run into a problem that I can't solve. When concatenating scripts, galp gives a syntax error, saying that it is impossible to use slash quotes in template: `tratata` (I don’t remember what they are called correctly).

Gulp Tasks: The task 'compile' has failed.
Caused by: SyntaxError: Unexpected character '`'

Of course, everything is solved by writing the template in one line and replacing the slash quotes with simple single ones. The example is given just to show that this structure works on the CodePen... I really would not want to write in a line if there is a very long code. Then it will be difficult to find the desired element.
Can you tell me how to get around this in vscode? Or maybe there is an extension or a plugin that solves this problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
nvdfxx, 2019-06-20
@Madeas

https://github.com/babel/gulp-babel

A
Andrey Suha, 2019-06-20
@andreysuha

Why gulp? Slash quotes are a feature from es6 and gulp, as far as I know, cannot work with babel, but this is not accurate)) in short, you need babel and most likely change gulp to webpack

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question