Reputation: 1178
I am trying to import external JS function from separate file into my Vue.js app which is running on TypeScript.
products_table.js
function init_products_table() {
console.log('test')
}
export {init_products_table as initProductsTable}
And I import it into my Vue component like this:
import { initProductsTable } from '../../products_table.js'
And I get this compile error:
TS7016: Could not find a declaration file for module '../../products_table.js'.
Upvotes: 2
Views: 3987
Reputation: 243
First if you use TS with Vue.JS you should enable JS in your 'tsconfig.json' file. After some recommendation:
If the problem persists please let me know.
Upvotes: 3