Closed kolya7k closed 9 months ago
The error message is telling you the problem.
Your project is not configured correctly for ECMAScript modules - But you are using the import
(modules) syntax in your file.
You'll most likely want to change your moduleResolution
to bundler
. Using NodeNext
is going to give you problems in a React application.
See something like the Vite React template for basic project configuration needs
If i do it it breaks Gulp (gulpfile.tsx) with
import zip from "bestzip";
^^^^^^
SyntaxError: Cannot use import statement outside a module
errors
i fixed it with adding
"ts-node": {
"compilerOptions": {
"moduleResolution": "NodeNext",
"module": "NodeNext"
}
},
to my tsconfig.json
thank you for the advice!
my tsconfig.json: