0

I've got a file like this:

import { createApp } from 'vue';
import router from './router'
import App from './App.vue';

createApp(App).use(router).mount('#products-category-app');

Does not contain any other row. Still, when the broswer loads the compiled file (which properly starts with an import statement), I get this:

Uncaught SyntaxError: import declarations may only appear at top level of a module

I'm currently compiling with Vitejs (thus rollup), pretty much basic/default options. The compiled file is something like this:

import{c as t,a as e,t as l,n as a,o as s,r as o,F as r,b as i,m as n,d as c,e as d,f as u,g as _,h as p,i as f,j as b}from"./vendor.13912ed1.js";const m={name:"ProductsTableColumn",props:["name","field_name","value","link","link_title"],computed:{classes()
[ETC..]

And here, there's only one import statement. So why is my browser complaining?

Luca Reghellin
  • 7,426
  • 12
  • 73
  • 118

0 Answers0