You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

跟随React Workshop实操遇Module not found报错求助

Fixing "Module not found: Can't resolve './AppRoutes'" in your React Project

Hey there! Let's work through fixing that annoying module error you're hitting while following your React workshop (you're at page 17/27, right?). Here are the key checks to resolve this:

  • Double-check the file's existence and location
    First, make sure you actually have an AppRoutes.js (or AppRoutes.jsx, depending on your project's file extension setup) in the same folder as the file trying to import it. For example, if you're importing from src/App.js, the AppRoutes file needs to live directly in src/ too. Also remember: StackBlitz uses a case-sensitive file system—so approutes.js won't match ./AppRoutes if the tutorial uses camel casing.

  • Verify your import statement matches the export type
    If the tutorial uses a default export for AppRoutes (like export default AppRoutes; at the bottom of the component file), your import should look like this:

    import AppRoutes from './AppRoutes';
    

    If it's a named export, you'll need curly braces:

    import { AppRoutes } from './AppRoutes';
    

    Most workshop tutorials use default exports for components like this, so start with the first format.

  • Confirm you've created the AppRoutes file as per the tutorial
    Since you're on page 17, it's possible the tutorial is walking you through creating this file right now—maybe you accidentally skipped that step! Flip back to page 17 and follow the instructions to create the AppRoutes file with the exact code from the workshop.

  • Restart your StackBlitz project
    Sometimes StackBlitz's cache can throw false module not found errors. Hit the "Restart" button in the top-right corner of the editor to refresh the project and clear any cached state.

内容的提问来源于stack exchange,提问作者Karolis

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 07:06:05