Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 138279

export was not found -- but names still work

$
0
0

I'm sure this is obvious, but I'm not seeing why this isn't working at the moment...

I have a file in a Vue project that exports keycodes in a couple different formats, one to be used for constants (allCodes) and another to be used for Vue (keyCodes):

export default {
  allCodes,
  keyCodes
};

When I try to import one of them using deconstruction like this, I get an error:

import { allCodes } from '@/helpers/keycodes';
21:17-25 "export 'allCodes' was not found in '@/helpers/keycodes'

 warning  in ./src/mixins/GlobalKeyPressHandler.js

However, importing then referring to the key by name works:

import object from '@/helpers/keycodes';
console.log('allCodes', object.allCodes);

What gives?


Viewing all articles
Browse latest Browse all 138279

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>