Module not found: Error: Can't resolve 'url' in 'D:\Weblabs\nodejs\redoc\src\utils'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
add a fallback 'resolve.fallback: { "url": require.resolve("url/") }'
install 'url'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "url": false }
ERROR in ./src/utils/helpers.ts 137:15-35
Module not found: Error: Can't resolve 'url' in 'D:\Weblabs\nodejs\redoc\src\utils'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
add a fallback 'resolve.fallback: { "url": require.resolve("url/") }'
install 'url'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "url": false }
ERROR in cli/index.ts:4:33
TS2307: Cannot find module 'update-notifier' or its corresponding type declarations.
2 | / tslint:disable:no-implicit-dependencies /
3 | import * as React from 'react';
4 | import * as updateNotifier from 'update-notifier';
| ^^^^^^^^^^^^^^^^^
5 | import { renderToString } from 'react-dom/server';
6 | import { ServerStyleSheet } from 'styled-components';
7 |
ERROR in cli/index.ts:8:25
TS2307: Cannot find module 'handlebars' or its corresponding type declarations.
6 | import { ServerStyleSheet } from 'styled-components';
7 |
8 | import { compile } from 'handlebars';
| ^^^^^^^^^^^^
9 | import { createServer, IncomingMessage, ServerResponse } from 'http';
10 | import { dirname, join, resolve, extname as getExtName } from 'path';
11 |
ERROR in cli/index.ts:17:23
TS2307: Cannot find module 'chokidar' or its corresponding type declarations.
15 | import { createStore, loadAndBundleSpec, Redoc } from 'redoc';
16 |
I know we made some changes to our dependencies since this issue was reported. Could you confirm if you're still unable to build the most recent release on windows please?
Describe the bug Cannot build on windows 10 system
Expected behavior A running local version
System: OS: Windows 10 10.0.19044 CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz Memory: 4.51 GB / 15.86 GB Binaries: Node: 16.14.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.17 - ~\AppData\Roaming\npm\yarn.CMD npm: 8.5.1 - C:\Program Files\nodejs\npm.CMD Browsers: Edge: Spartan (44.19041.1266.0), Chromium (108.0.1462.42) Internet Explorer: 11.0.19041.1566
Additional context
ERROR in ./src/utils/helpers.ts 137:15-35
Module not found: Error: Can't resolve 'url' in 'D:\Weblabs\nodejs\redoc\src\utils'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
ERROR in ./src/utils/helpers.ts 137:15-35
Module not found: Error: Can't resolve 'url' in 'D:\Weblabs\nodejs\redoc\src\utils'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
ERROR in cli/index.ts:4:33
TS2307: Cannot find module 'update-notifier' or its corresponding type declarations. 2 | / tslint:disable:no-implicit-dependencies / 3 | import * as React from 'react';
ERROR in cli/index.ts:8:25
TS2307: Cannot find module 'handlebars' or its corresponding type declarations. 6 | import { ServerStyleSheet } from 'styled-components'; 7 |
ERROR in cli/index.ts:17:23
TS2307: Cannot find module 'chokidar' or its corresponding type declarations. 15 | import { createStore, loadAndBundleSpec, Redoc } from 'redoc'; 16 |
ERROR in cli/index.ts:26:25
TS2307: Cannot find module 'mkdirp' or its corresponding type declarations. 24 | writeFileSync, 25 | } from 'fs';
ERROR in cli/index.ts:122:1
TS2769: No overload matches this call. Overload 1 of 7, '(command: string | readonly string[], showInHelp: false, builder?: ((args: Argv<{}>) => void) | ((args: Argv<{}>) => PromiseLike<Argv<{}>>) | ((args: Argv<{}>) => Argv<...>) | undefined, handler?: ((args: ArgumentsCamelCase<...>) => void | Promise<...>) | undefined, middlewares?: MiddlewareFunction<...>[] | undefined, deprecated?: string | ... 1 more ... | undefined): Argv<...>', gave the following error. Argument of type '"start the server"' is not assignable to parameter of type 'false'. Overload 2 of 7, '(command: string | readonly string[], description: string, builder?: ((args: Argv<{}>) => void) | ((args: Argv<{}>) => PromiseLike<Argv<{}>>) | ((args: Argv<{}>) => Argv<...>) | undefined, handler?: ((args: ArgumentsCamelCase<...>) => void | Promise<...>) | undefined, middlewares?: MiddlewareFunction<...>[] | undefined, deprecated?: string | ... 1 more ... | undefined): Argv<...>', gave the following error. Type '(res: { [argName: string]: unknown; : (string | number)[]; $0: string; }) => { [argName: string]: unknown; : (string | number)[]; $0: string; }' is not assignable to type 'MiddlewareFunction<{}>'. Type '{ [argName: string]: unknown; : (string | number)[]; $0: string; }' is not assignable to type 'void | Promise'.
Type '{ [argName: string]: unknown; : (string | number)[]; $0: string; }' is missing the following properties from type 'Promise': then, catch, [Symbol.toStringTag], finally
Overload 3 of 7, '(command: string | readonly string[], description: string, builder?: { [key: string]: Options; } | undefined, handler?: ((args: ArgumentsCamelCase<InferredOptionTypes<{ [key: string]: Options; }>>) => void | Promise<...>) | undefined, middlewares?: MiddlewareFunction<...>[] | undefined, deprecated?: string | ... 1 more ... | undefined): Argv<...>', gave the following error.
Argument of type '(yargs: Argv<{}>) => Argv<{}>' is not assignable to parameter of type '{ [key: string]: Options; }'.
Index signature is missing in type '(yargs: Argv<{}>) => Argv<{}>'.
120 | };
121 |
ERROR in cli/index.ts:122:1
TS2769: No overload matches this call. Overload 1 of 7, '(command: string | readonly string[], showInHelp: false, builder?: ((args: Argv<{}>) => void) | ((args: Argv<{}>) => PromiseLike<Argv<{}>>) | ((args: Argv<{}>) => Argv<...>) | undefined, handler?: ((args: ArgumentsCamelCase<...>) => void | Promise<...>) | undefined, middlewares?: MiddlewareFunction<...>[] | undefined, deprecated?: string | ... 1 more ... | undefined): Argv<...>', gave the following error. Argument of type '"bundle spec into zero-dependency HTML-file [deprecated]"' is not assignable to parameter of type 'false'. Overload 2 of 7, '(command: string | readonly string[], description: string, builder?: ((args: Argv<{}>) => void) | ((args: Argv<{}>) => PromiseLike<Argv<{}>>) | ((args: Argv<{}>) => Argv<...>) | undefined, handler?: ((args: ArgumentsCamelCase<...>) => void | Promise<...>) | undefined, middlewares?: MiddlewareFunction<...>[] | undefined, deprecated?: string | ... 1 more ... | undefined): Argv<...>', gave the following error. Type '(res: { [argName: string]: unknown; : (string | number)[]; $0: string; }) => { [argName: string]: unknown; : (string | number)[]; $0: string; }' is not assignable to type 'MiddlewareFunction<{}>'. Type '{ [argName: string]: unknown; : (string | number)[]; $0: string; }' is not assignable to type 'void | Promise'.
Type '{ [argName: string]: unknown; : (string | number)[]; $0: string; }' is not assignable to type 'Promise'.
Overload 3 of 7, '(command: string | readonly string[], description: string, builder?: { [key: string]: Options; } | undefined, handler?: ((args: ArgumentsCamelCase<InferredOptionTypes<{ [key: string]: Options; }>>) => void | Promise<...>) | undefined, middlewares?: MiddlewareFunction<...>[] | undefined, deprecated?: string | ... 1 more ... | undefined): Argv<...>', gave the following error.
Argument of type '(yargs: any) => any' is not assignable to parameter of type '{ [key: string]: Options; }'.
Index signature is missing in type '(yargs: any) => any'.
120 | };
121 |
ERROR in src/components/SideMenu/styled.elements.ts:1:10
TS2305: Module '"../../../node_modules/classnames"' has no exported member 'default'.