Skip to content
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

Build Failure with Liferay CLI on React Portlets Regardless of Node.js Version #1053

Open
FrederickBosa opened this issue Dec 5, 2024 · 0 comments

Comments

@FrederickBosa
Copy link

FrederickBosa commented Dec 5, 2024

Build Failure with Liferay CLI for React Portlets

Issue Description

Attempting to build a new React Portlet using Liferay CLI fails irrespective of the Node.js version. This issue significantly hampers the development processes for teams using Liferay CLI to manage React Portlets.

Steps to Reproduce

  1. Environment Setup: Clone a standard Liferay CLI React Portlet project.
  2. Install Dependencies: Run npm install to install necessary packages.
  3. Build Command: Execute npm run build or liferay build.

Actual Output

The build process fails, outputting the following error in the terminal:
```
Error: ---\src\AppComponent.js: Binding not found for ReferencedIdentifier "AppComponent" present in "AssignmentExpression".
```

Expected Output

The build process should complete successfully without errors, indicating the project was built correctly.

Debugging Steps Undertaken

  • Temporary Mitigation: Replacing package-lock.json with a previous version bypasses the error temporarily.
  • Node.js Versions Tested: Multiple, confirming the issue is not related to Node.js itself.

Minimal Code to Reproduce the Bug

```js
// Standard setup code for Liferay CLI React Portlet as generated by the CLI
```

Stack Trace

```
Error: C:\Users\frederick.bosa\Downloads\failed-build\src\AppComponent.js: Binding not found for ReferencedIdentifier "AppComponent" present in "AssignmentExpression".
at ReferencedIdentifier (C:\Users\frederick.bosa\Downloads\failed-build\node_modules\babel-plugin-minify-mangle-names\lib\index.js:199:19)
```

Configuration

  • babel-minify configuration: Default as configured by Liferay CLI.
  • .babelrc: Not manually adjusted, uses Liferay CLI defaults.

Use with Other Presets/Plugins

  • No additional babel presets or plugins were manually included beyond the default Liferay setup.

Environment

  • Build Tools: Liferay CLI
  • Module Bundlers and Task Runners: Utilized within Liferay's standard environment settings.

Additional Details

Conclusion

The recurring issue points towards a potential compatibility or configuration problem within the minification process utilized by Liferay's build tools, possibly related to babel-plugin-minify. The replacement of package-lock.json suggests dependency conflicts or specific versions causing the failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant