简体   繁体   English

React-Hot-Loader:由XXX引起的致命错误-找不到仪器

[英]React-hot-loader: fatal error caused by XXX - no instrumentation found

I'm trying to configure react-hot-loader 4.0.0 with React 16.2 and Webpack 2.6.1. 我正在尝试使用React 16.2和Webpack 2.6.1配置react-hot-loader 4.0.0。

It works for some changes, but for others I get the following error: 它适用于某些更改,但对于其他更改,我会收到以下错误:
React-hot-loader: fatal error caused by ƒ Connect(props, context) and React-hot-loader: fatal error caused by ƒ Connect(props, context)
no instrumentation found. Please require react-hot-loader before React. More in troubleshooting

I did indeed see the troubleshooting and it says I need to import react-hot-loader before I import React. 我确实确实看到了故障排除信息,并说我需要在导入React之前导入react-hot-loader。

Thing is, i'm not importing React. 问题是,我没有导入React。 I'm using it globally using webpack expose-loader. 我正在使用webpack Exposure-loader全局使用它。

I didn't really understand from the docs if I need to add this import to each component... 我不是真的从文档中了解是否需要将此导入添加到每个组件...

Any help would be greatly appreciated. 任何帮助将不胜感激。 Thanks, 谢谢,
Uri 宇里

Trying to resolve this issue I changed my React import so that instead of exposing it globally using the expose-loader, I import it in every file. 为了解决这个问题,我更改了React导入,以便将其导入每个文件中,而不是使用暴露加载器在全局范围内进行公开。 Then, I tried importing RHL after React (as stated in their troubleshooting page), but that didn't help either. 然后,我尝试在React之后导入RHL(如其疑难解答页面所述),但这也无济于事。

So, I can't pin point the exact reason for the error, but looking around RHL v4 issues I saw it does not support React Router v3. 因此,我无法指出错误的确切原因,但是环顾RHL v4问题,我发现它不支持React Router v3。 Upgrading to React Router v4 solved the issue for me . 升级到React Router v4为我解决了这个问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM