ciaddi
How to import functions in a .vue component from a .js file?
Hello, there is a function called getData inside my js file: "export const utils = {
getData: function () {
return "Test"
}
}". and then import { utils } from "/js/stats.js" but utils.getData() gives me the error "Cannot read properties of undefined (reading 'getData')". Also your suggestions doesnt work "[vite-node] [ERR_LOAD_URL] ~/js/stats.js"
10 replies