TypeError: Cannot read property 'replace' of undefined at Object.exports.removeComments
See original GitHub issue> NODE_ENV=production bankai build
14:56:54 ✨ Compiling & compressing files
14:56:54 ✨ created: dist
14:56:54 ✨ created: dist/manifest.json
14:56:54 ✨ created: dist/manifest.json.gz
14:56:54 ✨ created: dist/manifest.json.deflate
14:56:54 ✨ created: dist/manifest.json.br
events.js:183
throw er; // Unhandled 'error' event
^
TypeError: Cannot read property 'replace' of undefined
at Object.exports.removeComments (/Users/sril/src/stef/node_modules/combine-source-map/index.js:151:12)
at DestroyableTransform.write [as _transform] (/Users/sril/src/stef/node_modules/browser-pack/index.js:74:30)
at DestroyableTransform.Transform._read (/Users/sril/src/stef/node_modules/readable-stream/lib/_stream_transform.js:182:10)
at DestroyableTransform.Transform._write (/Users/sril/src/stef/node_modules/readable-stream/lib/_stream_transform.js:170:83)
at doWrite (/Users/sril/src/stef/node_modules/readable-stream/lib/_stream_writable.js:406:64)
at writeOrBuffer (/Users/sril/src/stef/node_modules/readable-stream/lib/_stream_writable.js:395:5)
at DestroyableTransform.Writable.write (/Users/sril/src/stef/node_modules/readable-stream/lib/_stream_writable.js:322:11)
at DestroyableTransform.ondata (/Users/sril/src/stef/node_modules/readable-stream/lib/_stream_readable.js:612:20)
at emitOne (events.js:116:13)
at DestroyableTransform.emit (events.js:211:7)
Relevant links:
Deps:
"devDependencies": {
"bankai": "^9.5.1"
},
"dependencies": {
"bel": "^5.1.6",
"choo": "^6.7.0",
"choo-devtools": "^2.3.3",
"choo-log": "^8.0.0",
"normalize.css": "^8.0.0",
"sheetify": "^7.2.0"
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
"TypeError: Cannot read property 'replace' of undefined" when ...
Bug Report I am using Docusaurus 2. I get this error when I run docusaurus build, Creating an optimized production build.
Read more >TypeError: Cannot read property 'replace' of Undefined in JS
The "Cannot read property 'replace' of undefined" error occurs when calling the replace() method on a variable that stores an undefined value.
Read more >js: TypeError: Cannot read property 'replace' of undefined using
I wanted to replace /\r?\n|\r/g with empty string but got a type error "Cannot read property 'replace' of undefined". export function ...
Read more >How to Avoid the Infamous "Cannot read properties of ... - Bitovi
As a JavaScript developer, I'm sure you've encountered the frustrating runtime TypeError Cannot read properties of undefined .
Read more >cannot read properties of undefined (reading 'map') typescript
I am trying to parse a json object into a functional component. NavBar component takes argument links as an array (via stringify json)....
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
I just tried deleting
package-lock.json
andnode_modules
and runningnpm i
andbankai build
seems to be working now, but nowbankai start
is having issues! 🙈 I’ll try to work out what on earth is going on now. Thanks for the help!thanks, yeah, seeing this too with your repro! this is because of an old bug in browser-pack-flat that was fixed in https://github.com/goto-bus-stop/browser-pack-flat/commit/ee119540133e6d1f12b999a6bbcb50daa37e303a (released as 3.0.1), but the package-lock.json in your repo still has it pinned to 3.0.0. running
npm update
should fix it locally, could you check if that helps?it’s a bit unfortunate that npm@5 doesn’t update existing deps on
npm install
anymore; makes this sort of thing easier to run into…