atlantabitdevs / bitdevs-upgrade

3 stars 3 forks source link

Error running `yarn start`: Cannot find module './meetup' or its corresponding type declarations. #77

Open lorenzolfm opened 7 months ago

lorenzolfm commented 7 months ago

Hi. I'm trying to run the project locally but ran into an error while running yarn start on the /ai project.

Node version: v18.17.0 Yarn version: 1.22.19

Steps to reproduce.

  1. Clone the repo and cd into the repo.
  2. Follow the AI Scraper and Summarizer instructions available in the GitHub file.
➜ yarn start
yarn run v1.22.19
$ yarn build && node build/index.js
$ rimraf ./build && tsc
src/index.ts:9:24 - error TS2307: Cannot find module './meetup' or its corresponding type declarations.

9 import { meetup } from './meetup'
                         ~~~~~~~~~~

Found 1 error in src/index.ts:9

error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

To fix the issue I copied the meetup.ts file located at the root of the project to ./ai/src and also the corresponding type file located at ./types/Meetup.ts to ./ai/src/types.

Turns out the meetup.ts file has an ai property that is being used on ./ai/src/index.ts. I suggest splitting this into two files. The meetup.ts file with only info about the meetup and an aiprompt.ts file with the information being consumed by the ai.

I'm opening a PR with my suggestion ASAP

austenjt commented 6 months ago

The solution is to copy the meetup.ts file from the root of the project into the ./ai folder right?

I worked around this by running yarn install && yarn build from the project root instead. Got miine working here: https://github.com/Portland-Bit-Devs/portland-bitdevs-upgrade

You can see my build steps in the Dockerfile I made.