TS2614
TS2614: Module
'./add.js'
has no exported memberadd
. Did you mean to useimport add from "./add.js"
instead?
Broken Code ❌
add.ts
1 |
|
main.ts
1 |
|
Fixed Code ✔️
There are multiple ways to fix this. The simplest would be turning your import statement into a default import:
1 |
|
An alternative solution would be using a named export:
1 |
|
You could actually use a named export and a default export in the same file:
1 |
|