I am beginning to learn React following a course.
When trying to watch or build Photoshop Samples I get this error:
[webpack-cli] Failed to load 'D:\UXP\ui-react-starter\webpack.config.js' config
[webpack-cli] Invalid options object. Copy Plugin has been initialized using an options object that does
not match the API schema.
- options[0] should be an object:
object { patterns, options? }
It looks like I have the wrong version of “webpack.config.js” for my setup. I tried to correct the error, but being a newbie i can’t find the answer.
I am using npm --version 8.1.2, node --version 16.13.2 & yarn --version 1.22.17
Is there an up to date version of “webpack.config.js” or can someone be generous and help me with the correction or do I have to get an older version of npm?
Hi @pdophoto, those versions for npm, node, and yarn should be fine. I see you’re trying to run the ui-react-starter sample. If you’re in the root directory and run yarn build, can you send me the logs you get there?
PS D:\UXP\ui-react-starter> yarn build
yarn run v1.22.17
$ webpack --mode development
[webpack-cli] Failed to load 'D:\UXP\ui-react-starter\webpack.config.js' config
[webpack-cli] Invalid options object. Copy Plugin has been initialized using an options object that does
not match the API schema.
- options[0] should be an object:
object { patterns, options? }
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Node v17+ may throw an error with webpack, but webpack has solved it with their latest update (not captured in the package.json) → so you may need to npm install webpack@latest
Ok, I give up.
The samples need to be updated, which an 80 year old newbie like myself can’t do.
How can I learn if I can’t see examples.
Back to my website course
And a BIG THANKS to amamdah for her help