I need to import a npm package but failed when I use "import" statement like this
import { cuteLuna } from 'lunacomponent'; and I got an error : cannot use import statement outside a module
after I change it to dynamic import, it works.
const cuteLuna = dynamic(() => import('lunacomponent').then((a) => a.cuteLuna), {ssr: false}); My question is, why should I use dynamic import instead of usual import?
thanks!!