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.

Failed to configure webpack entry

See original GitHub issue
// craco.config.js
const path = require('path');
const { env: { NODE_ENV } } = process;

module.exports = {
  webpack: {
    configure: {
      entry: path.resolve(__dirname, './src/main.js'),
      resolve: {
        alias: {
          '@': path.resolve(__dirname, './src'),
        },
      },
      devtool: NODE_ENV === 'development' ? 'eval-source-map' : 'hidden-source-map',
    },
  },
}


// terminal
// -> yarn start
// <- $ craco start
// <- Could not find a required file.
// <-  Name: index.js
// <-  Searched in: E:\projects\react-doc\src
// <- error Command failed with exit code 1.
// <- info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
patricklafrancecommented, Jun 19, 2020

Hi @chentianxin

It doesn’t seem to be an error related to CRACO.

CRACO let you customize CRA config but it is your responsibility to provide valid config.

Patrick

0reactions
patricklafrancecommented, Jun 29, 2020

Oh sorry I understand now.

Yes sadly in CRA they hardcoded a bunch of paths.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to configure webpack.config file - Stack Overflow
Try this: update your package json to this: { "name": "react-todo", "version": "1.0.0", "description": "", "main": "index.js", ...
Read more >
Entry Points - webpack
We will show you the ways you can configure the entry property, in addition to explaining why it may be useful to you....
Read more >
ERROR in Entry module not found: Error: Cannot resolve 'file ...
This is my webpack.config.js : module.exports = { entry: './index.js', output: { filename: 'bundle.
Read more >
IDE "failed to load" webpack config that exports function taking ...
IDE "failed to load" webpack config that exports function taking env and returning the config object · 1. Ensure that the Javascript language...
Read more >
All You Need to Know about Webpack in Examples - Medium
Run npx webpack — config webpack.dev.js : As you can see, inject:true property will ...
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