1

I have following declaration in the end of Types.ts:

export let selectItemList = {
  selectedInvoiceProvider: new SelectItemData<InvoiceProvider>(
    {
      "-": new SelectItemDataOption<InvoiceProvider>(InvoiceProvider.No),
      Billingo: new SelectItemDataOption<InvoiceProvider>(
        InvoiceProvider.Billingo
      ),
      "szamlazz.hu": new SelectItemDataOption<InvoiceProvider>(
        InvoiceProvider.Szamlazzhu
      ),
    },
    InvoiceProvider.No
  ),

But when I save and run I got this error:

Failed to compile.

./src/Types.ts Line 0: Parsing error: Cannot read property 'map' of undefined

If I remove export ALL WORKS, STRANGE


[EDIT]

I tried as Julian Kleine suggested, without any success:

const selectItemList = {
  selectedInvoiceProvider: new SelectItemData<InvoiceProvider>(
    {
      "-": new SelectItemDataOption<InvoiceProvider>(InvoiceProvider.No),
      Billingo: new SelectItemDataOption<InvoiceProvider>(
        InvoiceProvider.Billingo
      ),
      "szamlazz.hu": new SelectItemDataOption<InvoiceProvider>(
        InvoiceProvider.Szamlazzhu
      ),
    },
    InvoiceProvider.No
  ),
  // ...

export { selectItemList };

1 Answer 1

1

You should declare the constant first then export it

const myAwesomeValue = ...

export { myAwesomeValue }

somewhere else

import { myAwesomeValue } from "..."
Sign up to request clarification or add additional context in comments.

7 Comments

I tried your appoach, but does not work, would you check upper? I get same error.
Which error do you get now? The code is correct, there must be a different issue
the same: ./src/Types.ts Line 0: Parsing error: Cannot read property 'map' of undefined
There should be an issue within your class then. I don't see any map in your code
check your constructor function within one of the classes that you are using
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.