Closed a-rbsn closed 3 years ago
Getting the same error with a Nitro setup. Can't work out what might have changed. Build is fine.
(node:2896) [DEP_WEBPACK_WATCH_WITHOUT_CALLBACK] DeprecationWarning: A 'callback' argument need to be provided to the 'webpack(options, callback)' function when the 'watch' option is set. There is no way to handle the 'watch' option without a callback.
Have searched on “DEP_WEBPACK_WATCH_WITHOUT_CALLBACK” and seems to be a common problem with many potential solutions.
The webpack hot load seems flakier than Browsersync in this setup? I don’t know. Everything else here works a treat :)
@claysondesign What is your approach on using this with nitro? I am new with webpack, and I want to test it with nitro, but I get the same issue as described above, and no css or tailwind working.
More or less using as this repo and have tried a few amends, but it always falls over worse. All paths and assets set up .env or config/general.php seem to working well when not in dev mode.
Nitro works pretty well, but a little limited (no https). Reliant on Multipass on the Mac and apparently not M1 ready either if you’re lucky enough to go there.
If this nice little stack works on Mamp Pro or Valet that would be interesting.
Have tried this now on a fresh install and Nitro 2.03 BETA
Still the same issue but webpack update and search suggests that in package.json scripts to remove the --watch to prevent further errors
Change:
"dev": "cross-env NODE_ENV=development webpack serve --watch --config ./wpconfig/webpack.dev.js",
to
"dev": "cross-env NODE_ENV=development webpack serve --config ./wpconfig/webpack.dev.js",
Have tried this now on a fresh install and Nitro 2.03 BETA
Still the same issue but webpack update and search suggests that in package.json scripts to remove the --watch to prevent further errors
Change:
"dev": "cross-env NODE_ENV=development webpack serve --watch --config ./wpconfig/webpack.dev.js",
to
"dev": "cross-env NODE_ENV=development webpack serve --config ./wpconfig/webpack.dev.js",
This appears to be correct - webpack-cli 4.4.0 -> 4.5.0 is where the change occurred. Update to the project coming :) Thanks!
Looks good. Does this solve the original "Cannot GET /" issue for you?
Still the same for me on Nitro 2.05 BETA
https://testdomain.nitro/ is fine but Webpack watch url doesn't want to know :( https://testdomain.nitro:8080/
I have the same problem. When I runyarn dev
and I browse to localhost:8080 I get the same message: Cannot get /
The Master repo is today installed. In the package.json I have: cross-env NODE_ENV=development webpack serve --mode development --config ./wpconfig/webpack.dev.js
I have the same problem. When I run
yarn dev
and I browse to localhost:8080 I get the same message: Cannot get / The Master repo is today installed. In the package.json I have:cross-env NODE_ENV=development webpack serve --mode development --config ./wpconfig/webpack.dev.js
The same here, any fix?
@BramBeekman That is because there's no index file in your dist
folder - it's not required, though! The asset files are still served. If you try and load one directly, it should work. The latest release includes code and instructions on how to make it generate an index file, if you really want one.
Edit: Here's a link right to the code block you would use: https://github.com/mizziness/craft3-webpack5-tailwind2-boilerplate/blob/main/wpconfig/webpack.common.js#L45-L54
How are you accessing your homepage when the index file is not being generated? How do you access other templates when no files are generated in web/dist in dev mode?
Just chipping in here as I'm also seeing the 'Cannot GET /' message. No errors in the terminal. CSS and JS is being built fine with the build command. I am however using MAMP and I'm not sure how to connect the two? Pretty confused if I'm being honest with how the template files in /templates are getting rendered with Webpack-dev-server?
I'm not sure why but I'm encountering the following issues:
yarn build
seems to successfully apply the css/js in the src folder and createweb/dist/js
andweb/dist/css
accordinglyyarn dev
gives the following:When I go to
localhost:8080
I get the following error:Cannot GET /
— when I visit the site locally using Valet atdomain.test
I see the website but none of the CSS is applied. Although this is in DevTools:Any thoughts would be greatly appreciated.
Best, Andrew