question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Watcher doesn't see a new file called "index.js" inside a subfolder

See original GitHub issue

Description

I have an app with this folder structure :

src
├── App
│   ├── App.css
│   ├── App.js
│   ├── App.test.js
│   ├── index.js
│   └── logo.svg
├── index.css
├── index.js

Inside the index.js file, I have this line : import App from './App

Which causes this error :

Failed to compile.

Error in ./src/index.js
Module not found: [CaseSensitivePathsPlugin] `/home/benoit/Development/react-spring-template/client/src/App.js` does not match the corresponding path on disk - File does not exist.

When I add a / at the end of the path, then it works. import App from './App

Is there a reason why the folder import doesn’t work without a trailing slash, or is this a bug ?

Expected behavior

I should be able to import something from the index.js file of a subfolder without putting a trailing slash at the end of the folder.

Actual behavior

I need to put a trailing slash at the end of the import statement if it’s a folder.

Environment

Run these commands in the project folder and fill in their results:

  1. npm ls react-scripts (if you haven’t ejected):
npm ls react-scripts
client@0.1.0 /home/benoit/Development/react-spring-template/client
└── react-scripts@0.8.1
  1. node -v: v7.2.0
  2. npm -v: 4.0.2

Then, specify:

  1. Operating system: Archlinux
  2. Browser and version: Chrome

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
gaearoncommented, Mar 7, 2017

No, progress doesn’t happen without somebody pushing for it. 😉

I tagged issue as needing contributors. If you’d like to help, you’ll probably need to figure out where this breaks on Webpack side. I don’t know if this is even feasible to fix or not.

2reactions
gaearoncommented, Dec 5, 2016

Can you consistently reproduce this, after stopping and starting the development server again?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Watcher doesn't see a new file called "index.js" inside a subfolder
Watcher doesn't see a new file called "index.js" inside a subfolder.
Read more >
Unable to get a subfolder in directory - Stack Overflow
However in my code I'm only seem to be able to load the .js files in the Commands folder rather than the sub...
Read more >
The File System Access API: simplifying access to local files
To save a file, call showSaveFilePicker() , which shows the file picker in "save" mode, allowing the user to pick a new file...
Read more >
Content Configuration - Tailwind CSS
Configuring source paths. Tailwind CSS works by scanning all of your HTML, JavaScript components, and any other template files for class names, ...
Read more >
File Watchers | IntelliJ IDEA Documentation - JetBrains
To use a tool that is not on the list, choose Custom. The New Watcher dialog opens. In the Name field, type the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found