Skip to content

Local development fails: yarn fetch-data:local cannot find generated/types #240

@nicolelaine

Description

@nicolelaine

Description

Following the README instructions for local development results in a failure during the fetch-data:local step, which prevents the application from running locally.

Steps to reproduce

  • Clone the repository
  • Create .env.local as described in the README at root level
  • Run:
yarn install
yarn fetch-data:local

Expected behavior

  • yarn fetch-data:local runs successfully
  • Required local data files (e.g. fullData/staticData.json) are generated
  • yarn dev starts without build-time module resolution errors

Actual behavior

Running yarn fetch-data:local fails with:

TSError: ⨯ Unable to compile TypeScript:
scripts/fetchData.ts:4:30 - error TS2307: Cannot find module '../generated/types'

Notes

  • The generated/types directory does not exist after cloning the repository
  • yarn install does not create this directory
  • The README does not document a step that generates generated/types
  • The failure seems to occur before any API requests are made
  • When skipping the fetch-data:local step and going directly to yarn dev, the following error occurs on port 3020:
Failed to compile

./src/pages/[locale]/index.tsx:26:0
Module not found: Can't resolve 'fullData/staticData.json'
  24 | import Section from 'components/Section';
  25 | import getBlogs, { Blog } from 'utils/requests/getBlogs';
> 26 | import data from 'fullData/staticData.json';
  27 | 
  28 | import i18nextConfig from '@/next-i18next.config';
  29 | 

https://nextjs.org/docs/messages/module-not-found

Let me know if you have any questions, and happy to help with any testing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions