Cannot use import statement outside a module when importing a const from another js file

Viewed 4156

I am developing a chrome extension.

One of my js files contains a const object.

I tried to import this from another js file in the same directory.

Uncaught SyntaxError: Cannot use import statement outside a module

In my attributes.js

export const key_attributes = {
    'GK': ['Aerial', 'Agility', 'Handling', 'Reflexes'],
}

I have the above

In table.js, I have

import { key_attributes } from './attributes'

This gives me

Uncaught SyntaxError: Cannot use import statement outside a module`

Any help?

0 Answers
Related