Enonic version: 7.14.4
OS: Ubuntu 22.04
I’m trying to upgrade the react4xp version of an old project following the official guide here. However, I am encountering the following error when running the build:
> Task :react4xpComponents FAILED
> @enonic/react4xp@3.1.2 webpack:components /my-project/node_modules/@enonic/react4xp
> npx webpack --config dist/webpack.config.components.js "--env" "DIR_PATH_ABSOLUTE_PROJECT=/my-project" "--env" "BUILD_ENV=production" "--env" "VERBOSE=false"
/my-project/node_modules/@enonic/react4xp/react4xp.config.js not found, which is fine :)
/my-project/node_modules/@enonic/react4xp/webpack.config.react4xp.js not found, which is fine :)
react4xp-build-entriesandchunks used entrySets (array[1]): [
{
"sourcePath": "/my-project/node_modules/@enonic/react4xp/src/main/resources/site",
"sourceExtensions": [
"jsx",
"tsx"
],
"targetSubDir": "site"
}
]
react4xp-build-components can't continue - no entries were found (entries={}). Tip: the combination of entryDirs and entryExtStringArrayensions in react4xp.config.js was resolved to the entrySets above. Check the content of those directories, with those file extensions. Add entry source files, adjust react4xp.config.js, or run the build with -i for more info.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @enonic/react4xp@3.1.2 webpack:components: `npx webpack --config dist/webpack.config.components.js "--env" "DIR_PATH_ABSOLUTE_PROJECT=/my-project" "--env" "BUILD_ENV=production" "--env" "VERBOSE=false"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @enonic/react4xp@3.1.2 webpack:components script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/.npm/_logs/2024-12-17T11_45_47_736Z-debug.log
npm ERR! weird error 1
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react4xpComponents'.
> Process 'command '/my-project/.gradle/nodejs/node-v14.16.1-linux-x64/bin/npm'' finished with non-zero exit value 1
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.3/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
BUILD FAILED in 20s
The error indicates that no entries were found, and it’s related to the configuration of entryDirs and entryExtensions. I’ve followed all the steps in the upgrade guide, but I’m unsure where to check or what to adjust next. Additional Information:
- I’m currently using react4xp@2.0.0 and trying to upgrade to @enonic/react4xp@3.1.2.
- Gradle version 8.3 and node version 14.
- The error occurs during the build process when running the webpack:components script.
- The project directory structure seems to be correct, but the build is not finding any components to process.
What I’ve Tried:
- I confirmed that the files in the src/main/resources/site directory do have .jsx and .tsx files.
- I’ve checked and updated react4xp.config.js, but I’m not sure what changes are needed to resolve the missing entries issue.
Has anyone encountered this issue before? How can I ensure that react4xp-build-components can find the necessary entry files for the build?