Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File is not defined when creating a File Obect #8

Open
dush88c opened this issue Sep 4, 2021 · 2 comments
Open

File is not defined when creating a File Obect #8

dush88c opened this issue Sep 4, 2021 · 2 comments

Comments

@dush88c
Copy link

dush88c commented Sep 4, 2021

should be able to create FIle Object which is available in Typescript

Actual Behavior

GIve error saying File is not defined :

Steps to Reproduce the Problem code sample

var file2 = new File(["asdasdsa"], 'metadata.json');
   console.log(file2.name);

Specifications

  • Version: 4.4
  • Platform:
@metachris
Copy link
Owner

metachris commented Sep 4, 2021

What's your compiler flags / full tsc command to reproduce the error?

@dush88c
Copy link
Author

dush88c commented Sep 4, 2021

export const delayMillis = (delayMs: number): Promise<void> => new Promise(resolve => setTimeout(resolve, delayMs));

export const greet = (name: string): string => `Hello ${name}`

export const foo = async (): Promise<boolean> => {
  console.log(greet('World'))
  await delayMillis(1000)
  console.log('done')
   var file:File = new File(["asdasdsa"], 'metadata.json');
   console.log(file.name);
  return true
}

I added my File Object creation code sinp into your main.ts and run npm run cli command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants