Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

cannot use import statement outside a module typescript

// Fix 1
Change .js files to .cjs
// Fix 2
Add "type": "module" to package.json
 
PREVIOUS NEXT
Tagged: #import #statement #module #typescript
ADD COMMENT
Topic
Name
9+5 =