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

TypeError: includes of undefined on Faker.system.commonFileName() #770

Closed
HonzaMac opened this issue Apr 4, 2022 · 5 comments · Fixed by #771
Closed

TypeError: includes of undefined on Faker.system.commonFileName() #770

HonzaMac opened this issue Apr 4, 2022 · 5 comments · Fixed by #771
Assignees
Labels
c: bug Something isn't working p: 2-high Fix main branch s: accepted Accepted feature / Confirmed bug

Comments

@HonzaMac
Copy link
Contributor

HonzaMac commented Apr 4, 2022

Describe the bug

On latest version 6.1.1 (and on 6.1) generation of faker.system.commonFileName() fails in some cases.

Our problem
Screenshot 2022-04-04 at 9 13 17

TypeError: Cannot read properties of undefined (reading 'includes')

Reproduction

Running failing test here:
https://stackblitz.com/edit/node-9fatlp?file=test/suite.test.ts

Cherry-picked steps for failure:

faker.seed(5423027051750305);
faker.setLocale('sk');
faker.system.commonFileName('xml'); // works
faker.system.commonFileName('xml'); // fail

Output
image

Additional Info

No response

@HonzaMac HonzaMac added the s: pending triage Pending Triage label Apr 4, 2022
@HonzaMac HonzaMac changed the title Faker.system.commonFileName() fails to generate with error "includes" Faker.system.commonFileName() fails to generate with error TypeError: includes of undefined Apr 4, 2022
@HonzaMac HonzaMac changed the title Faker.system.commonFileName() fails to generate with error TypeError: includes of undefined TypeError: includes of undefined on Faker.system.commonFileName() Apr 4, 2022
@ra100
Copy link

ra100 commented Apr 4, 2022

It fails often for the locale sk.

@ST-DDT
Copy link
Member

ST-DDT commented Apr 4, 2022

I'll have a look.

@ST-DDT ST-DDT added c: bug Something isn't working s: accepted Accepted feature / Confirmed bug and removed s: pending triage Pending Triage labels Apr 4, 2022
@Shinigami92 Shinigami92 moved this to Todo in Faker Roadmap Apr 4, 2022
@Shinigami92 Shinigami92 added this to the v6.1 - First bugfixes milestone Apr 4, 2022
@ST-DDT ST-DDT self-assigned this Apr 4, 2022
@ST-DDT ST-DDT added the p: 2-high Fix main branch label Apr 4, 2022
@ST-DDT ST-DDT moved this from Todo to In Progress in Faker Roadmap Apr 4, 2022
@ST-DDT
Copy link
Member

ST-DDT commented Apr 4, 2022

The issue is that the address.state method in random.word returns undefined.
I'll create a fix that skips undefined words.

@ST-DDT
Copy link
Member

ST-DDT commented Apr 4, 2022

Will be fixed in #771 and will be in v6.1.2 (probably released this evening CEST)

@ST-DDT ST-DDT moved this from In Progress to Awaiting Review in Faker Roadmap Apr 4, 2022
Repository owner moved this from Awaiting Review to Done in Faker Roadmap Apr 4, 2022
@HonzaMac
Copy link
Contributor Author

HonzaMac commented Apr 4, 2022

Thank you all for fast fix!

@ST-DDT ST-DDT removed this from Faker Roadmap Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: bug Something isn't working p: 2-high Fix main branch s: accepted Accepted feature / Confirmed bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants