fredx87 / openapi-mock-generator Goto Github PK
View Code? Open in Web Editor NEWProgressive Web App for generating mocked data from an OpenAPI specification
Home Page: https://fredx87.github.io/openapi-mock-generator
License: MIT License
Progressive Web App for generating mocked data from an OpenAPI specification
Home Page: https://fredx87.github.io/openapi-mock-generator
License: MIT License
Hi.
I've tried to run this in docker image based on node:12.18 and node:latest -
FROM node:latest
ENV NODE_OPTIONS="--max-old-space-size=2048"
ENV NODE_OPTIONS="--max_old_space_size=2048"
WORKDIR /usr/src/app
RUN npm i openapi-mock-generator@>=1.0.0
WORKDIR /usr/src/app/node_modules/openapi-mock-generator
RUN npm i
RUN echo "SKIP_PREFLIGHT_CHECK=true" > .env
EXPOSE 3000
RUN NODE_OPTIONS="--max_old_space_size=2048"
CMD [ "tail", "-f", "/dev/null" ]
After docker buid
and docker run
I'd open inner docker CLI and use npm run-script start
, but everything crashes:
I saw this in console and browser window:
Failed to compile.
/usr/src/app/node_modules/openapi-mock-generator/src/features/document/DocumentTree.tsx
TypeScript error in /usr/src/app/node_modules/openapi-mock-generator/src/features/document/DocumentTree.tsx(48,9):
Type 'ReactNode[]' is not assignable to type 'ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>[] | ... 7 more ... | undefined'.
Type 'ReactNode[]' is not assignable to type 'ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>[]'.
Type 'ReactNode' is not assignable to type 'ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>'.
Type 'undefined' is not assignable to type 'ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>'. TS2322
46 | return (
47 | <TreeNode selectable={false} key={node.ref} title={title}>
> 48 | {node.children.map(child => renderNode(child, searchTerm))}
| ^
49 | </TreeNode>
50 | );
51 | }
Then I've tried npm run-script build
with similar result:
> [email protected] build /usr/src/app/node_modules/openapi-mock-generator
> react-app-rewired build
Creating an optimized production build...
Failed to compile.
Failed to minify the bundle. Error: static/js/2.f457e00a.chunk.js from Terser
Error: Call retries were exceeded
at /usr/src/app/node_modules/openapi-mock-generator/node_modules/react-scripts/scripts/build.js:196:23
at finalCallback (/usr/src/app/node_modules/openapi-mock-generator/node_modules/react-scripts/node_modules/webpack/lib/Compiler.js:257:39)
at /usr/src/app/node_modules/openapi-mock-generator/node_modules/react-scripts/node_modules/webpack/lib/Compiler.js:273:13
at AsyncSeriesHook.eval [as callAsync] (eval at create (/usr/src/app/node_modules/openapi-mock-generator/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:24:1)
at AsyncSeriesHook.lazyCompileHook (/usr/src/app/node_modules/openapi-mock-generator/node_modules/tapable/lib/Hook.js:154:20)
at onCompiled (/usr/src/app/node_modules/openapi-mock-generator/node_modules/react-scripts/node_modules/webpack/lib/Compiler.js:271:21)
at /usr/src/app/node_modules/openapi-mock-generator/node_modules/react-scripts/node_modules/webpack/lib/Compiler.js:681:15
at AsyncSeriesHook.eval [as callAsync] (eval at create (/usr/src/app/node_modules/openapi-mock-generator/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
at AsyncSeriesHook.lazyCompileHook (/usr/src/app/node_modules/openapi-mock-generator/node_modules/tapable/lib/Hook.js:154:20)
at /usr/src/app/node_modules/openapi-mock-generator/node_modules/react-scripts/node_modules/webpack/lib/Compiler.js:678:31
at AsyncSeriesHook.eval [as callAsync] (eval at create (/usr/src/app/node_modules/openapi-mock-generator/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
at AsyncSeriesHook.lazyCompileHook (/usr/src/app/node_modules/openapi-mock-generator/node_modules/tapable/lib/Hook.js:154:20)
at /usr/src/app/node_modules/openapi-mock-generator/node_modules/react-scripts/node_modules/webpack/lib/Compilation.js:1423:35
at AsyncSeriesHook.eval [as callAsync] (eval at create (/usr/src/app/node_modules/openapi-mock-generator/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
at AsyncSeriesHook.lazyCompileHook (/usr/src/app/node_modules/openapi-mock-generator/node_modules/tapable/lib/Hook.js:154:20)
at /usr/src/app/node_modules/openapi-mock-generator/node_modules/react-scripts/node_modules/webpack/lib/Compilation.js:1414:32
Read more here: https://bit.ly/CRA-build-minify
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `react-app-rewired build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build 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! /root/.npm/_logs/2020-07-28T04_40_34_232Z-debug.log
I read the https://create-react-app.dev/docs/troubleshooting/#npm-run-build-fails-to-minify article but react-scripts
in package.json is "react-scripts": "^3.4.1"
. Where is my mistake? My goal is running copy of openapi-mock-generator as webpage
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.