简体   繁体   English

在React中找不到模块错误代码

[英]Cannot find module error code in react

I am getting a "cannot find module" error. 我收到“找不到模块”错误。 All the screenshots from atom are attached. 原子的所有屏幕截图均已附加。 i believe i am entering the correct filepaths when calling the search_bar file. 我相信我在调用search_bar文件时输入了正确的文件路径。

Here is a link to the google doc with all the screenshots: https://docs.google.com/document/d/1Yt2YrapLw04kKk5tnIxyEik6RAJbBpTpl-CSaAYZzE8/edit?usp=sharing 这是带有所有屏幕截图的Google文档的链接: https : //docs.google.com/document/d/1Yt2YrapLw04kKk5tnIxyEik6RAJbBpTpl-CSaAYZzE8/edit?usp=sharing

bundle.js:64 Uncaught Error: Cannot find module 
"./components/search_bar"
at webpackMissingModule (bundle.js:64)
at Object.<anonymous> (bundle.js:64)
at __webpack_require__ (bundle.js:20)
at Object.<anonymous> (bundle.js:47)
at __webpack_require__ (bundle.js:20)
at bundle.js:40
at bundle.js:43

I found it! 我找到了! From the NPM Start process, issue was that in the search_bar file, i had written the following at the top: 在NPM启动过程中,问题是在search_bar文件中,我在顶部写了以下内容:

import React from ('react'); 从('react')导入React;

The parenthesis around 'react' were screwing it up... 围绕“反应”的括号把它搞砸了……

All working fine now... 现在一切正常...

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

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