-
-
Notifications
You must be signed in to change notification settings - Fork 611
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]: ERROR in main: Can't resolve ./src
#1843
Comments
./src
./src
can you once try if the following is working ? -
|
Thanks for reporting I'm looking into it. |
> webpack serve --config .webpack/index.js --mode development --entry src/index.tsx
[webpack-cli]
Error: you provided an invalid entry point.
[webpack-cli] ValidationError: Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema.
- configuration.entry should be an non-empty array.
-> All modules are loaded upon startup. The last one is exported.
[webpack-cli] Promise rejection: TypeError: Cannot read property 'compilers' of undefined
[webpack-cli] TypeError: Cannot read property 'compilers' of undefined
at Object.getDevServerOptions [as default] (/Users/<path-to-project>/my-app/node_modules/@webpack-cli/serve/lib/getDevServerOptions.js:15:32)
at Object.startDevServer [as default] (/Users/<path-to-project>/my-app/node_modules/@webpack-cli/serve/lib/startDevServer.js:22:59)
at /Users/<path-to-project>/my-app/node_modules/@webpack-cli/serve/lib/index.js:21:33 |
Have a look at this to reproduce the issue: https://github.com/bahtou/webpack-server-issue/tree/master |
I found the bug, CLI was adding webpack-cli/packages/webpack-cli/lib/utils/GroupHelper.js Lines 19 to 21 in 0f13ab5
|
@snitin315 Feel free to send a PR, I think we should remove whole logic, because it is invalid |
EDIT: #1837 should fix this, @snitin315 can you check once I push? I'll fix CI today |
Sure 👍🏻 |
I might be totally out of depth here, but something I found worth noting is that in the following, the webpack-cli/packages/webpack-cli/lib/webpack-cli.js Lines 20 to 29 in 55d0bd8
Also, the following webpack-cli/packages/webpack-cli/lib/webpack-cli.js Lines 219 to 224 in 55d0bd8
traces back to webpack-cli/packages/webpack-cli/lib/utils/GroupHelper.js Lines 19 to 21 in 55d0bd8
as @snitin315 mentioned. This (IMO) means that the webpack-cli supports just index.js as an entry point. Finally, I would also like to work on this issue if possible. A fix would be to take in as the argument the entryPath for the webpack-cli constructor. I'm just starting out on Webpack, any pointers appreciated :)
|
On it 👍 |
Fixed, let's close, but if somebody faced with the issue again, feel free to open a new issue |
@evilebottnawi what will I need to do get this working (from above)? https://github.com/bahtou/webpack-server-issue/tree/master I have updated the package |
@bahtou we will do new rc release in Monday, so you will need just update 😄 |
@bahtou I'm not a 100 percent sure, but the following might work before Monday :): |
@gairTanm bleeding-edge is ` "webpack": "^5.0.0-rc.3", correct? From the above repo: https://github.com/bahtou/webpack-server-issue/tree/master, I'm still getting an error. Could be something else? |
@bahtou I think you'll have to install the |
Hello! The issue persists for me in the production build. Steps to reproduce:
Package versions:
|
Hey @wtchnm 👋 Thanks for the report, so I cloned your repo and it seems to be some issue with configs in import App from "./components/App"; And it compiled fine, you can use this as a workaround for now, will look into the behaviour in depth. |
Hello @anshumanv! Thanks for investigating. I followed your directions and webpack compiled fine. |
If I convert my webpack production config from a function to a plain object, webpack also compiles fine. The bug appears to be on this line:
The configuration resolved on
|
Thanks for the insights, will fix it in near future. |
@anshumanv, I can make a PR to check if |
Sure, feel free to PR. I don't think that will be enough since we're just adding another property on the object before assigning it again. You can start with creating a test which will fail now and debug and fix it. |
Confirming the bug still persists on my current setup. Changing the filename |
@anshumanv can you open a new issue in webpack-cli repo and describe workaround and we will fix the issue in near future |
confirming that this is working for my configuration as expected
thanks everyone! Edit |
@bahtou you don't need |
Describe the bug
I have the following project folder structure:
When I use
.webpack/index.js
to import a specific environment configuration I get the following error:To Reproduce
package.json
.webpack/index.js
.webpack/development.js
> webpack serve --config .webpack/index.js --mode development
Expected behavior
Expected the
src
directory to be resolved. If instead.webpack/index.js
has the configuration there is no error that shows up.Please paste the results of
webpack-cli info
here, and mention other relevant informationThe text was updated successfully, but these errors were encountered: