Question: I have a components.js file that looks like this:

```
import { lookCoordinate } from './tools.js'; // I get: SyntaxError: Unexpected token {

Vue.component('coordform', {
  template: `<form id="popup-box" @submit.prevent="process" v-if="visible"><input type="text" autofocus refs="coordinput" v-model="coords"></input></form>`,
  data() {
    {
      return { coords: '', visible: false }
    }
  },
  created() {
    window.addEventListener('keydown', this.toggle)
  },
  destroyed() {
    window.removeEventListener('keydown', this.toggle)
  },
  methods: {
    toggle(e) {
      if (e.key == 'g') {
        if (this.visible) {
          this.visible = false;
        } else
          this.visible = true;
      }
    },
    process() {
      lookCoordinate(this.coords) // Tried to import from tools.js
    }
  }
});

```

But I'm getting:
`Uncaught SyntaxError: Unexpected token {`

How do I import a function from another plain JS file and use it within a Vue component?

Thanks.

Answer: 
It is supported if you add script with `type="module"`:

```
<script type="module" src="main.js"></script>

```
Can you please try this without `{}`.

```
import { lookCoordinate } from './tools.js'

```

`{}` is used when you define multiple functions inside tools.js

like,

```
import { lookCoordinate, lookCoordinate2 } from './tools.js'

```