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

regex.test is not a function #607

Closed
kitze opened this issue Nov 8, 2016 · 5 comments
Closed

regex.test is not a function #607

kitze opened this issue Nov 8, 2016 · 5 comments
Labels

Comments

@kitze
Copy link
Contributor

kitze commented Nov 8, 2016

@kadira/storybook v2.29.3

=> Loading custom .babelrc
=> Loading custom webpack config.
/Users/kitze/webdev/personal/x/client/node_modules/@kadira/storybook/dist/server/config.js:102
return regex.test('my_package.json');
^

TypeError: regex.test is not a function

Got this error with the newest version of storybook. Am I doing something wrong?

@arunoda
Copy link
Member

arunoda commented Nov 8, 2016

Could you send me a copy of your custom webpack config?
This might be related to this PR.

@kitze
Copy link
Contributor Author

kitze commented Nov 8, 2016

I just submitted a PR that fixes it. Btw I'm using custom-react-scripts. This is the webpack config.

@arunoda
Copy link
Member

arunoda commented Nov 8, 2016

Hmm. I couldn't find the issue by looking at the source. Seems everything fine for me.
Could you try what's coming for the regex variable in that code. I'm curious to what's that?

Also could you tell me how to re-produce with this custom scripts?
So, I could do a test.

@kitze
Copy link
Contributor Author

kitze commented Nov 8, 2016

Oh, I see the problem. This has nothing to do with react-custom-scripts and that webpack.config file.

My webpack config for storybook includes a test that's not a regex, but it's a function. I don't know if you know that "test" accepts both a regex and a function. So that's where it crashes.

@kitze
Copy link
Contributor Author

kitze commented Nov 8, 2016

I just updated the PR with this commit.

The thing here is that if the test is a regex, it should be tested, as it was, but if it's a function, it should be also called with the "my_package.json" parameter.

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

No branches or pull requests

2 participants