I'm trying to use fetch-jsonp, so I type npm i fetch-jsonp to download it and its in my package.json dependencies. Then I try to import it using:
import fetchJsonp from 'fetch-jsonp';
at the top of my main.js but it keep getting this error:
SyntaxError: import declarations may only appear at top level of a module
What is causing this? My file structure is:
JS -> main.js
node_modules -> fetch-jsonp
.gitignore
index.html
package.json