reader icon indicating copy to clipboard operation
reader copied to clipboard

npm run build failed because shared files are not found

Open hargup opened this issue 10 months ago • 21 comments

Error:

$ npm run build

> build
> tsc -p .

src/cloud-functions/crawler.ts:3:79 - error TS2307: Cannot find module '../shared' or its corresponding type declarations.

3 import { CloudHTTPv2, Ctx, Logger, OutputServerEventStream, RPCReflect } from '../shared';
                                                                                ~~~~~~~~~~~

src/db/crawled.ts:2:33 - error TS2307: Cannot find module '../shared/lib/firestore' or its corresponding type declarations.

2 import { FirestoreRecord } from '../shared/lib/firestore';
                                  ~~~~~~~~~~~~~~~~~~~~~~~~~

src/db/crawled.ts:9:21 - error TS4112: This member cannot have an 'override' modifier because its containing class 'Crawled' does not extend another class.

9     static override collectionName = 'crawled';
                      ~~~~~~~~~~~~~~

src/db/crawled.ts:11:14 - error TS4112: This member cannot have an 'override' modifier because its containing class 'Crawled' does not extend another class.

11     override _id!: string;
                ~~~

src/db/crawled.ts:36:21 - error TS4112: This member cannot have an 'override' modifier because its containing class 'Crawled' does not extend another class.

36     static override from(input: any) {
                       ~~~~

src/db/crawled.ts:46:14 - error TS4112: This member cannot have an 'override' modifier because its containing class 'Crawled' does not extend another class.

46     override degradeForFireStore() {
                ~~~~~~~~~~~~~~~~~~~

src/index.ts:6:50 - error TS2307: Cannot find module './shared' or its corresponding type declarations.

6 import { loadModulesDynamically, registry } from './shared';
                                                   ~~~~~~~~~~

src/services/puppeteer.ts:4:24 - error TS2307: Cannot find module '../shared/services/logger' or its corresponding type declarations.

4 import { Logger } from '../shared/services/logger';
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/services/puppeteer.ts:178:43 - error TS2339: Property 'fromFirestoreQuery' does not exist on type 'typeof Crawled'.

178             const cached = (await Crawled.fromFirestoreQuery(Crawled.COLLECTION.where('urlPathDigest', '==', digest).orderBy('createdAt', 'desc').limit(1)))?.[0];
                                              ~~~~~~~~~~~~~~~~~~

src/services/puppeteer.ts:178:70 - error TS2339: Property 'COLLECTION' does not exist on type 'typeof Crawled'.

178             const cached = (await Crawled.fromFirestoreQuery(Crawled.COLLECTION.where('urlPathDigest', '==', digest).orderBy('createdAt', 'desc').limit(1)))?.[0];
                                                                         ~~~~~~~~~~

src/services/puppeteer.ts:232:25 - error TS2339: Property 'save' does not exist on type 'typeof Crawled'.

232                 Crawled.save(
                            ~~~~

src/services/puppeteer.ts:240:26 - error TS7006: Parameter 'err' implicitly has an 'any' type.

240                 ).catch((err) => {
                             ~~~


Found 12 errors in 4 files.

Errors  Files
     1  src/cloud-functions/crawler.ts:3
     5  src/db/crawled.ts:2
     1  src/index.ts:6
     5  src/services/puppeteer.ts:4

To reproduce go to backend/functions and run npm run build from an account which doesn't have access to the thinapps-shared/backend.

It looks like the thinapps-shared backend does mostly logging monitoring and caching, but at this point, the project doesn't build without it.

hargup avatar Apr 14 '24 08:04 hargup

I encountered same issue.

chinobing avatar Apr 15 '24 06:04 chinobing

same issue, Please provide a reproducible installation method

berwinjoule avatar Apr 15 '24 07:04 berwinjoule

I encountered same issue.

Boom199801 avatar Apr 15 '24 10:04 Boom199801

same issue

wondergcj avatar Apr 15 '24 12:04 wondergcj

Same issue:

`src/cloud-functions/crawler.ts:3:79 - error TS2307: Cannot find module '../shared' or its corresponding type declarations.

3 import { CloudHTTPv2, Ctx, Logger, OutputServerEventStream, RPCReflect } from '../shared'; ~~~~~~~~~~~

src/db/crawled.ts:2:33 - error TS2307: Cannot find module '../shared/lib/firestore' or its corresponding type declarations.

2 import { FirestoreRecord } from '../shared/lib/firestore'; ~~~~~~~~~~~~~~~~~~~~~~~~~

src/db/crawled.ts:9:21 - error TS4112: This member cannot have an 'override' modifier because its containing class 'Crawled' does not extend another class.

9 static override collectionName = 'crawled'; ~~~~~~~~~~~~~~

src/db/crawled.ts:11:14 - error TS4112: This member cannot have an 'override' modifier because its containing class 'Crawled' does not extend another class.

11 override _id!: string; ~~~

src/db/crawled.ts:36:21 - error TS4112: This member cannot have an 'override' modifier because its containing class 'Crawled' does not extend another class.

36 static override from(input: any) { ~~~~

src/db/crawled.ts:46:14 - error TS4112: This member cannot have an 'override' modifier because its containing class 'Crawled' does not extend another class.

46 override degradeForFireStore() { ~~~~~~~~~~~~~~~~~~~

src/index.ts:6:50 - error TS2307: Cannot find module './shared' or its corresponding type declarations.

6 import { loadModulesDynamically, registry } from './shared'; ~~~~~~~~~~

src/services/puppeteer.ts:4:24 - error TS2307: Cannot find module '../shared/services/logger' or its corresponding type declarations.

4 import { Logger } from '../shared/services/logger'; ~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/services/puppeteer.ts:178:43 - error TS2339: Property 'fromFirestoreQuery' does not exist on type 'typeof Crawled'.

178 const cached = (await Crawled.fromFirestoreQuery(Crawled.COLLECTION.where('urlPathDigest', '==', digest).orderBy('createdAt', 'desc').limit(1)))?.[0]; ~~~~~~~~~~~~~~~~~~

src/services/puppeteer.ts:178:70 - error TS2339: Property 'COLLECTION' does not exist on type 'typeof Crawled'.

178 const cached = (await Crawled.fromFirestoreQuery(Crawled.COLLECTION.where('urlPathDigest', '==', digest).orderBy('createdAt', 'desc').limit(1)))?.[0]; ~~~~~~~~~~

src/services/puppeteer.ts:232:25 - error TS2339: Property 'save' does not exist on type 'typeof Crawled'.

232 Crawled.save( ~~~~

src/services/puppeteer.ts:240:26 - error TS7006: Parameter 'err' implicitly has an 'any' type.

240 ).catch((err) => { ~~~ `

saliksik avatar Apr 15 '24 14:04 saliksik

same issue

cifangyiquan avatar Apr 16 '24 01:04 cifangyiquan

same issue

laijiahua avatar Apr 16 '24 03:04 laijiahua

Can this project be deployed completely locally and independently?

yuri2peter avatar Apr 16 '24 04:04 yuri2peter

See https://github.com/jina-ai/reader/issues/14

Use the API for now.

nomagick avatar Apr 16 '24 09:04 nomagick

这个项目的开源,就像笑话一样。做一个半成品放在这里。高效吗?整半天纯浪费时间。什么文档都没有。

faceAngus avatar Apr 30 '24 06:04 faceAngus

Searching the codebase for from '../shared/services yields many files making this totally unusable locally or even deployable on my own!

Korayem avatar Apr 30 '24 17:04 Korayem

Has anyone deployed successfully?

HereOrCode avatar May 05 '24 05:05 HereOrCode

Has anyone deployed successfully?

The repo isn't deployable. Though I read the code and it looks like Mozilla's readability library is the main thing powering this API https://github.com/mozilla/readability

hargup avatar May 05 '24 06:05 hargup

这个项目的开源,就像笑话一样。做一个半成品放在这里。高效吗?整半天纯浪费时间。什么文档都没有。

image 也就是说最重要的部分不开源。开源的跑不起来

twwch avatar May 20 '24 03:05 twwch

Good news! Now you can self-host reader API. Spent a lot of time and removed all the thinapps-shared modules from my clone of reader API. https://github.com/hargup/reader

Happy coding :)

hargup avatar Aug 15 '24 11:08 hargup

Good news! Now you can self-host reader API. Spent a lot of time and removed all the thinapps-shared modules from my clone of reader API. https://github.com/hargup/reader

Happy coding :)

My friend you are a real hero.

ParseDark avatar Sep 07 '24 06:09 ParseDark