TypeError: require(...)(...) is not a function

Insert picture description here
The code I used is

const {
    
    connect,initSchemas} = require('./init.js')

(async ()=>{
    
    
  await connect();
  initSchemas();
})();

This is a very strange error. The async function can be operated with the immediate execution function.
It was later discovered that a semicolon must be added after const. .

const {
    
    connect,initSchemas} = require('./init.js');

(async ()=>{
    
    
  await connect();
  initSchemas();
})();

Guess you like

Origin blog.csdn.net/d1063270962/article/details/114024337