Throw Error: AlgoliaSearchCore.js:13 Uncaught ReferenceError: process is not defined
yunyuyuan opened this issue · comments
云与原 commented
$ npm run start:docs
> qing-design@0.0.0 start:docs /Users/qc/PycharmProjects/qing-design
> docgeni serve --port 4600
Module Name | Emit Count
Docs | 8
Components | 1
Total Emit Files | 21
Build at: 2021/10/22 09:48:09 - Time: 173ms - Version: 1.1.2
✔ Docgeni compiled successfully.
Start run ng serve site --base-href / --port 4600 for site...
Option "baseHref" is deprecated: Use the "baseHref" option in the browser builder instead.
'node-sass' usage is deprecated and will be removed in a future major version. To opt-out of the deprecated behaviour and start using 'sass' uninstall 'node-sass'.
✔ Browser application bundle generation complete.
Initial Chunk Files | Names | Size
main.js | main | 0 bytes
polyfills.js | polyfills | 0 bytes
runtime.js | runtime | 0 bytes
styles.css | styles | 0 bytes
vendor.js | vendor | 0 bytes
| Initial Total | 0 bytes
Lazy Chunk Files | Names | Size
components-qing-design-button-index.js | components-qing-design-button-index | 0 bytes
Build at: 2021-10-22T01:48:24.130Z - Hash: 7853ef22be60a8d0dc68 - Time: 7419ms
Warning: /Users/qc/PycharmProjects/qing-design/node_modules/@docgeni/template/__ivy_ngcc__/fesm2015/docgeni-template.js depends on 'docsearch.js'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
Error: site/src/app/content/components/custom/index.ts:12:23 - error TS7005: Variable 'COMPONENTS' implicitly has an 'any[]' type.
12 declarations: [...COMPONENTS],
~~~~~~~~~~
Error: site/src/app/content/components/custom/index.ts:13:26 - error TS7005: Variable 'COMPONENTS' implicitly has an 'any[]' type.
13 entryComponents: [...COMPONENTS]
~~~~~~~~~~
Error: site/src/app/content/components/custom/index.ts:5:7 - error TS7034: Variable 'COMPONENTS' implicitly has type 'any[]' in some locations where its type cannot be determined.
5 const COMPONENTS = [
~~~~~~~~~~
Error: site/src/app/content/example-loader.ts:15:25 - error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ "qf-button-size-example": { key: string; name: string; title: string; componentName: string; module: { name: string; importSpecifier: string; }; sourceFiles: { name: string; highlightedPath: string; }[]; additionalFiles: never[]; additionalComponents: never[]; }; "qf-button-theme-example": { ...; }; }'.
No index signature with a parameter of type 'string' was found on type '{ "qf-button-size-example": { key: string; name: string; title: string; componentName: string; module: { name: string; importSpecifier: string; }; sourceFiles: { name: string; highlightedPath: string; }[]; additionalFiles: never[]; additionalComponents: never[]; }; "qf-button-theme-example": { ...; }; }'.
15 const example = EXAMPLE_COMPONENTS[exampleKey];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: site/src/app/content/example-loader.ts:17:13 - error TS7053: Element implicitly has an 'any' type because expression of type 'any' can't be used to index type 'LibExampleLoader'.
17 this[example.module.importSpecifier]().then(result => {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error: site/src/app/content/example-loader.ts:17:57 - error TS7006: Parameter 'result' implicitly has an 'any' type.
17 this[example.module.importSpecifier]().then(result => {
~~~~~~
** Angular Live Development Server is listening on localhost:4600, open your browser on http://localhost:4600/ **
云与原 commented
我在出错的地方加上了@ts-ignore
,然后运行ng serve site --base-href / --port 4600
,可以正常运行,但是浏览器报错了:
AlgoliaSearchCore.js:13
Uncaught ReferenceError: process is not defined
at Object.0Ul8 (AlgoliaSearchCore.js:13)
at __webpack_require__ (bootstrap:84)
at Object.uyml (algoliasearchLite.js:3)
at __webpack_require__ (bootstrap:84)
at Object.cq35 (DocSearch.js:15)
at __webpack_require__ (bootstrap:84)
at Object.YQXE (main.js:11)
at __webpack_require__ (bootstrap:84)
at Object.UjO/ (index.js:3)
at __webpack_require__ (bootstrap:84)
0Ul8 @ AlgoliaSearchCore.js:13
__webpack_require__ @ bootstrap:84
uyml @ algoliasearchLite.js:3
__webpack_require__ @ bootstrap:84
cq35 @ DocSearch.js:15
__webpack_require__ @ bootstrap:84
YQXE @ main.js:11
__webpack_require__ @ bootstrap:84
UjO/ @ index.js:3
__webpack_require__ @ bootstrap:84
25pZ @ docgeni-template.js:1
__webpack_require__ @ bootstrap:84
MCbZ @ app.module.ts:2
__webpack_require__ @ bootstrap:84
agQk @ index.ts:22
__webpack_require__ @ bootstrap:84
0 @ main.js:11
__webpack_require__ @ bootstrap:84
checkDeferredModules @ bootstrap:45
webpackJsonpCallback @ bootstrap:32
(匿名) @ main.js:1