Problems with `dom-iterator` and webpack
See original GitHub issueThe dom-iterator
dependency causes problems in my webpack project when I import from react-live
. Webpack tries to package the xor
require()
which is in a catch
block in that package. The error looks like this:
Error: ./~/dom-iterator/index.js
Module not found: Error: Cannot resolve module 'xor' in directory/node_modules/dom-iterator
resolve module xor in directory/node_modules/dom-iterator
looking for modules in directory
directory/xor doesn't exist (module as directory)
resolve 'file' xor in directory
resolve file
directory/xor doesn't exist
directory/xor.js doesn't exist
directory/xor.jsx doesn't exist
directory/xor.cjsx doesn't exist
directory/xor.coffee doesn't exist
directory/xor.ts doesn't exist
directory/xor.tsx doesn't exist
directory/xor.json doesn't exist
directory/xor.less doesn't exist
directory/xor.css doesn't exist
directory/xor.scss doesn't exist
directory/xor.sass doesn't exist
directory/xor.toml doesn't exist
directory/xor.yml doesn't exist
directory/xor.yaml doesn't exist
Any suggestions on how to get around this problem? Note this also happens for the props
module required the same way in that module.
Oddly, I don’t have this problem with development builds, only production builds. Possibly something in my webpack config?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:10 (4 by maintainers)
Top Results From Across the Web
The Problem with Webpack and Why It Is (Kind of) Our Fault
The problem with Webpack is that it does not pick a side. It wants to be batteries-included but pluggable, standalone but extensible, ...
Read more >How I solved and debugged my Webpack issue through trial ...
When webpack bundles your source code, it can become difficult to track down errors and warnings to their original location.
Read more >Compare Versions | @teambit/application | npm
We found errors while resolving dependencies that may result in an incomplete or inaccurate dependency graph. Show details. Errors found while resolving some ......
Read more >recursive-iterator - npm Package Health Analysis | Snyk
The npm package recursive-iterator was scanned for known vulnerabilities and missing license, and no issues were found. Thus the package was deemed as...
Read more >API Changes from v3 to v4 - CKEditor 4 Documentation
... plugins/domiterator/plugin.js => core/dom/iterator.js; plugins/htmldataprocessor/plugin.js => core/htmldataprocessor.js ...
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
Hi all 😄
I’ve encountered this same issue when running
yarn build
on a Gatsby site that also usesreact-live
(v1.7.1). Patching the Webpack config to ignore thexor
andprops
plugins (as described above) is a successful short term workaround. So thanks for that!In case it’s at all helpful, my Gatsby project is available at bvaughn/react/tree/gatsby/www.
I solved this problem by creating a
gatsby-node.js
file like follows:Hopefully that works, I extracted it from a much bigger file.