jsonforms-editor
jsonforms-editor copied to clipboard
I am not able to run on windows 10
Description Sorry I am not able to run this application on windows. After cloning this repository I have followed the steps mentioned in the readme.
Node Version: v12.18.2 NPM Version: 6.14.5 TSC Version: Version 4.0.2
I can able to run:
- npm ci
- npm run init
but failed to run the command "npm run build" The delete command rm -rf dist is not applicable to windows. So manually I run the command "tsc --p tsconfig.build.json" But it was throwing error "The operand of a 'delete' operator must be optional.ts(2790)" in the /jsonforms-editor/src/core/modeluischema.ts file.
So commented out the line 101 delete current.uuid; Manually run the command "tsc --p tsconfig.build.json" and executed successfully.
Then I run the command cd app && npm run start the application started and throwing the prettier error.
Failed to compile
./src/App.tsx
Line 1:4: Delete ␍ prettier/prettier
Line 2:73: Delete ␍ prettier/prettier
Line 3:43: Delete ␍ prettier/prettier
Line 4:22: Delete ␍ prettier/prettier
Line 5:73: Delete ␍ prettier/prettier
Line 6:73: Delete ␍ prettier/prettier
Line 7:4: Delete ␍ prettier/prettier
Line 8:26: Delete ␍ prettier/prettier
Line 9:27: Delete ␍ prettier/prettier
Line 10:26: Delete ␍ prettier/prettier
Line 11:24: Delete ␍ prettier/prettier
Line 12:32: Delete ␍ prettier/prettier
Line 13:27: Delete ␍ prettier/prettier
Line 14:1: Delete ␍ prettier/prettier
Line 15:78: Delete ␍ prettier/prettier
Line 16:46: Delete ␍ prettier/prettier
Line 17:61: Delete ␍ prettier/prettier
Line 18:1: Delete ␍ prettier/prettier
Line 19:50: Delete ␍ prettier/prettier
Line 20:27: Delete ␍ prettier/prettier
Line 21:19: Delete ␍ prettier/prettier
Line 22:34: Delete ␍ prettier/prettier
Line 23:45: Delete ␍ prettier/prettier
Line 24:47: Delete ␍ prettier/prettier
Line 25:18: Delete ␍ prettier/prettier
Line 26:68: Delete ␍ prettier/prettier
Line 27:72: Delete ␍ prettier/prettier
Line 28:7: Delete ␍ prettier/prettier
Line 29:20: Delete ␍ prettier/prettier
Line 30:5: Delete ␍ prettier/prettier
Line 31:3: Delete ␍ prettier/prettier
Search for the keywords to learn more about each error.
Can you please guide me on how to set up and run this application. Thanks.
I have changed the End of line sequence from CRLF to LF in the VS code editor for the .tsx files. Now I got a different error from the JSON forms editor package.
Failed to compile ../jsonforms-editor/src/core/components/Formatted.tsx 10:0 Module parse failed: The keyword 'interface' is reserved (10:0) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders | import React from 'react'; |
interface FormattedJsonProps { | object?: any; | }
Hi @nandhu , thank you for your report. We will take a look.
Best
FWIW, I too had the problem. I removed all the non-windows stuff from the build script (just leaving the tsc call) but still got the following. I believe I followed all the steps correctly...
C:\git\portflowio\jsonforms-editor>npm run build
> root@ build C:\git\portflowio\jsonforms-editor
> lerna run build
lerna notice cli v3.22.1
lerna info Executing command in 2 packages: "npm run build"
lerna info run Ran npm script 'build' in '@jsonforms/editor' in 6.9s:
> @jsonforms/[email protected] build C:\git\portflowio\jsonforms-editor\jsonforms-editor
> tsc --p tsconfig.build.json
lerna ERR! npm run build exited 1 in 'jsonforms-editor'
lerna ERR! npm run build stdout:
> [email protected] build C:\git\portflowio\jsonforms-editor\app
> rescripts build
Creating an optimized production build...
Failed to compile.
Cannot find module 'vs/editor/standalone/browser/quickOpen/gotoLine'
Require stack:
- C:\git\portflowio\jsonforms-editor\node_modules\monaco-editor-webpack-plugin\out\index.js
- C:\git\portflowio\jsonforms-editor\app\.rescriptsrc.js
- C:\git\portflowio\jsonforms-editor\node_modules\@rescripts\utilities\paths.js
- C:\git\portflowio\jsonforms-editor\node_modules\@rescripts\utilities\index.js
- C:\git\portflowio\jsonforms-editor\node_modules\@rescripts\cli\loader.js
- C:\git\portflowio\jsonforms-editor\node_modules\@rescripts\cli\scripts\build.js
Hi @jeffmcaffer , we might have version issues. See here: https://github.com/microsoft/monaco-editor/issues/2143 Could you check your versions?
I've since deleted the repo so can't check. Ultimately I just followed the instructions. While I did have to hack to remove the non-Windows script bits, I didn't do anything specific for monaco. So I assume it was using whatever version jsonforms specifies/wants on a fresh install.
I have the same error as @nandhu. How do we fix that error Failed to compile ../jsonforms-editor/src/core/components/Formatted.tsx 10:0 Module parse failed: The keyword 'interface' is reserved (10:0) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders | import React from 'react'; |
interface FormattedJsonProps { | object?: any; | }
Any help is appreciated.
Thanks
Hi @vivekarza, with #122 we'll refactor the build which hopefully also fixes the Windows issues.
Hi, I solved it by editing these 3 files:
-
jsonforms-editor\package.json (use Window commands) replace:
"build": "rm -rf dist && tsc --p tsconfig.build.json && cp src/JsonFormsEditor.css dist",by"build": "del /s /q dist && tsc --p tsconfig.build.json && copy src\\JsonFormsEditor.css dist", -
.eslintrc.js (ignore end of line LF by CLRF) replace:
'prettier/prettier': 'error',by'prettier/prettier': ['error', { endOfLine: 'auto' }], -
app\.rescriptsrc.js (replace slash for double backslash) replace:
inQuestion.include.includes('app/src')byinQuestion.include.includes('app\\src')and replace:loader.include.replace('app/src', 'jsonforms-editor/src'),byloader.include.replace('app\\src', 'jsonforms-editor\\src'),
@emmanuel14 , Appreciate your help. Yes was able to run the app. Thanks Much.
@emmanuel14 thank you so much!