-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Error when running build: "Cannot read property 'endsWith' of undefined" #1247
Comments
I'm running into this same problem... |
TL:DRput the following add the following dangerouslyupdatewebpackconfig to your dangerouslyUpdateWebpackConfig(webpackConfig, env) {
webpackConfig.output = {
...webpackConfig.output,
publicPath: process.env.PUBLIC_URL || ''
};
return webpackConfig;
} Root CauseOkay, I've tracked down the problem. With the newer version of Styleguidist does take the output webpack config from FixThe fix for this is that styleguidist should include a Workarounduntil a fix is in you can use the module.exports = {
webpackConfig: require('react-scripts/config/webpack.config.js'),
dangerouslyUpdateWebpackConfig(webpackConfig, env) {
webpackConfig.output = {
...webpackConfig.output,
publicPath: process.env.PUBLIC_URL || ''
};
return webpackConfig;
}
} |
Thanks for the investigation! I have some concerns on passing the app’s path or |
@sapegin I'll need to verify but create-react-app "expects" this pattern with its config so if you are using their webpack config you should be okay. I dug through all the code paths to figure out what |
Requiring users to add a new config value for something that's already working without isn't an option. Can we pass something like an empty string? |
I'm not suggesting a required option just the ability to add one if you need since it's dependent on the webpack config you are using. This way instead of having to use
then in make-webpack-config.js L37-L41 would become
|
Again: you’re suggesting to introduce an option for a feature that already works out of the box. |
It does not work out of the box with the latest versions of please see #1243 for the work around that allows you to point styleguidist at the webpack config that now ships with |
I also have this issue, I agree with @osbornm, as of today it does not work out of the box. |
The difference between I have found another workaround, that is to set
in This will force Currently, I have not found any issues with this workaround. |
@lucifer1004 thank you, it works! Not sure what is the implication of always forcing the |
This comment has been minimized.
This comment has been minimized.
🎉 This issue has been resolved in version 9.0.6 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Current behavior
When trying to build the styleguide with
npx styleguidist build
aftercreate-react-app
and copying thecra
example components folder I'm getting this error:To reproduce
From my fork repository:
https://github.com/jgalazm/react-styleguidist
run
and you will get the error
From scratch, inside the repo's folder run:
Then create
styleguide.config.js
with this content (see #1243)Copy the components from the cra example folder:
And build it:
Here is when the error appears:
Expected behavior
After running
To have the static files located in the
styleguide
folder. This already works for the originalcra/
example.The text was updated successfully, but these errors were encountered: