uiwjs / uiwjs/react-codemirror

When using react-codemirror in packaging, the following is the reason for the error

Open
#532 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.3k
Forks
161
PR merge metrics
No merged PRs in 30d

Description

Failed to create a production build!
[INFO] project_page.js from UglifyJs
[INFO] SyntaxError: Unexpected token: name (Text) [./~/@codemirror/state/dist/index.cjs:8,0]
[INFO] error Command failed with exit code 1.
[INFO] error Command failed with exit code 1.info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:05 min
[INFO] Finished at: 2023-07-04T14:41:48+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.9.1:yarn (yarn run script) on project sonar-example-plugin: Failed to run task: 'yarn run build' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Here is my package.json:
{
"name": "sonar-custom-plugin-example",
"license": "LGPL-3.0",
"version": "7.0.0",
"devDependencies": {
"autoprefixer": "6.2.2",
"babel-core": "6.14.0",
"babel-jest": "18.0.0",
"babel-loader": "6.2.5",
"babel-preset-react-app": "0.2.1",
"cross-env": "2.0.0",
"cross-spawn": "4.0.0",
"css-loader": "0.23.1",
"detect-port": "1.0.0",
"dotenv": "2.0.0",
"enzyme": "^3.10.0",
"expose-loader": "0.7.1",
"express": "4.13.4",
"express-http-proxy": "0.6.0",
"filesize": "3.3.0",
"find-cache-dir": "0.1.1",
"gzip-size": "3.0.0",
"imports-loader": "0.6.5",
"jest": "18.0.0",
"json-loader": "0.5.4",
"path-exists": "2.1.0",
"postcss-loader": "0.8.0",
"prettier": "0.22.0",
"react": "16.13.0",
"react-dev-utils": "0.2.1",
"react-dom": "16.13.0",
"react-transform-hmr": "1.0.4",
"recursive-readdir": "2.1.0",
"rimraf": "2.5.4",
"script-loader": "0.6.1",
"strip-ansi": "3.0.1",
"style-loader": "0.13.0",
"webpack": "1.13.2",
"webpack-dev-server": "1.16.1"
},
"scripts": {
"build": "node scripts/build.js",
"start": "node scripts/start.js",
"test": "node scripts/test.js"
},
"babel": {
"presets": [
"react-app"
]
},
"jest": {
"coverageDirectory": "/target/coverage",
"coveragePathIgnorePatterns": [
"/node_modules",
"/tests"
],
"moduleFileExtensions": [
"jsx",
"js",
"json"
],
"moduleNameMapper": {
"^.+\.(hbs|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "/conf/jest/FileStub.js",
"^.+\.css$": "/conf/jest/CSSStub.js"
},
"setupFiles": [
"/conf/jest/SetupTestEnvironment.js"
],
"snapshotSerializers": [
"enzyme-to-json/serializer"
],
"testPathIgnorePatterns": [
"/node_modules",
"/scripts",
"/conf"
]
},
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with package.json and scripts/build.js, then reproduce the production build that invokes UglifyJs and fails in @codemirror/state/dist/index.cjs. Compare the configured Babel and webpack versions with the failing dependency; done means the reported production build completes successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
babel, javascript, react, webpack
Domain
build-system, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.