/ / index.js
const {query} = require("./sql");
export async function getUser(name){
let sql = `select name,password from users whername="${name}" `;
let user = await query(sql)
return user;
}
/ / server.js
import {getUser} from "./index.js"
error
C:\Users\love4\WebstormProjects\shoppingList\koa\server.js:4
import {getUser} from "./index.js"
^^^^^^
SyntaxError: Unexpected token import
it can be used normally if you use module.exports and require.
is it necessary to configure babel? I didn"t seem to have a problem before I set up ES6 in webstorm