InlineChunkHtmlPlugin Cannot read property 'endsWith' of undefined
See original GitHub issueIs this a bug report?
Yes
Did you try recovering your dependencies?
Yes.
Which terms did you search for in User Guide?
InlineChunkHtmlPlugin publicPath
Environment
The npx create-react-app --info
commands generates an error…
Steps to Reproduce
I have a project based on CRA2.0 that I ejected. I am using Styleguidist to show my React components. When I build with Styleguidist it uses the webpack.config.prod.js of my project to obtains some data. The issue is I am getting the following error:
TypeError: Cannot read property 'endsWith' of undefined
TypeError: Cannot read property 'endsWith' of undefined
at InlineChunkHtmlPlugin.apply (C:\Git\web-react-components-library\node_modules\react-dev-utils\InlineChunkHtmlPlugin.js:33:21)
at webpack (C:\Git\web-react-components-library\node_modules\webpack\lib\webpack.js:47:13)
at build (C:\Git\web-react-components-library\node_modules\react-styleguidist\scripts\build.js:5:9)
at commandBuild (C:\Git\web-react-components-library\node_modules\react-styleguidist\bin\styleguidist.js:96:19)
When I look at the InlineChunkHtmlPlugin apply function I can see that it looks for compiler.options.output.publicPath
but in case of Styleguidist this value is undefined.
Expected Behavior
The InlineChunkHtmlPlugin apply function should probably test if the publicPath is valid before continuing.
Thanks.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Cannot read property 'endsWith' of undefined - Redux Toolkit ...
I'm getting back TypeError: Cannot read property 'endsWith' of undefined when running the test with the addMatcher s in the slice.
Read more >Error: Cannot read property "endsWith" of undefined
Hello, I have add a button to a page.... now I get error: Cannot read property "endsWith" of undefined Even if I delete...
Read more >r3f-react-app - CodeSandbox
n\u002F\u002F We can't use a relative path in HTML because we don't want to load ... allows you to set a fallback for...
Read more >CRA Browser Extension - Bartekus.com
Ever wanted to use CRA as foundation for building an awesome browser extension but weren't sure how to get everything working?
Read more >webpack怎么配置才能把内联js改为src引用呢? | 菜鸟教程网
__esModule) return e; var r = Object.create(null); if (l.r(r), Object. ... shouldInlineRuntimeChunk && new InlineChunkHtmlPlugin(HtmlWebpackPlugin, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@DavidHenri008 This error shouldn’t arrive if you have publicPath defined in your webpack config.
We cannot reproduce this. If this is for an ejected project we’d be happy to take a PR making our plugins more flexible.