Answer the question
In order to leave comments, you need to log in
How to solve puppeteer and typescript friendship problem?
Good afternoon! Maybe someone has come across a similar one: There are tests written in puppeteer
and there is a certain binding module over the usual "typograf"
one (npm and typograf), which is written in Typescript. I want to connect a typographer to the tests, but puppeteer
in the console it swears at a function written in TS.
Function:
declare function T(strings: TemplateStringsArray, ...args: any[]): string;
T`Проверьте имя`,
ReferenceError: T is not defined
Answer the question
In order to leave comments, you need to log in
It seems that your babel is crooked.
Here is a description of the plugin used - it should remove the T-function after assembly, which obviously did not happen.
// Source string
T`Formatted "string". `;
// Typografed string
// Tagged template with tag `T` is converted to a regular template literal
`Formatted “string”.`;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question