this post was submitted on 28 Mar 2024
12 points (87.5% liked)

Lemmy

2172 readers
47 users here now

Everything about Lemmy; bugs, gripes, praises, and advocacy.

For discussion about the lemmy.ml instance, go to [email protected].

founded 4 years ago
MODERATORS
 

UPDATE: running pnpm run translations:generate (and also the other translations tasks, just to be sure) fixed the issue.


When trying to setup a local Lemmy instance (for development), the lemmy-ui repository throws an error when trying to start the dev server.

I followed the guide: https://join-lemmy.org/docs/contributors/02-local-development.html

When running pnpm dev to start the dev server, it presents me with two errors:


ERROR in ./src/shared/services/I18NextService.ts 14:0-40
Module not found: Error: Can't resolve '../translations/en' in '/home/ff0000/workspace/lemmy/lemmy-ui/src/shared/services'
resolve '../translations/en' in '/home/ff0000/workspace/lemmy/lemmy-ui/src/shared/services'
  using description file: /home/ff0000/workspace/lemmy/lemmy-ui/package.json (relative path: ./src/shared/services)
    using description file: /home/ff0000/workspace/lemmy/lemmy-ui/package.json (relative path: ./src/shared/translations/en)
      no extension
        /home/ff0000/workspace/lemmy/lemmy-ui/src/shared/translations/en doesn't exist
      .js
        /home/ff0000/workspace/lemmy/lemmy-ui/src/shared/translations/en.js doesn't exist
      .jsx
        /home/ff0000/workspace/lemmy/lemmy-ui/src/shared/translations/en.jsx doesn't exist
      .ts
        /home/ff0000/workspace/lemmy/lemmy-ui/src/shared/translations/en.ts doesn't exist
      .tsx
        /home/ff0000/workspace/lemmy/lemmy-ui/src/shared/translations/en.tsx doesn't exist
      as directory
        /home/ff0000/workspace/lemmy/lemmy-ui/src/shared/translations/en doesn't exist
 @ ./src/shared/dynamic-imports.ts 6:0-69 48:17-41
 @ ./src/server/index.tsx 16:0-65 47:2-22

ERROR in ./src/shared/services/I18NextService.ts 159:43-129
Module not found: Error: Can't resolve '../translations' in '/home/ff0000/workspace/lemmy/lemmy-ui/src/shared/services'
 @ ./src/shared/dynamic-imports.ts 6:0-69 48:17-41
 @ ./src/server/index.tsx 16:0-65 47:2-22

webpack 5.91.0 compiled with 2 errors in 14393 ms

I do see that these files nor the folder exist where I18NextService is trying to locate them. But i also see in the root a lemmy-translations folder.

I am able to get it sort of working by updating the paths in I18NextService, but i guess that is not the preferred approach.

top 2 comments
sorted by: hot top controversial new old
[โ€“] [email protected] 2 points 8 months ago (1 children)

Just a hunch, but is it possible you missed the --recursive flag when cloning the repo?

[โ€“] [email protected] 2 points 8 months ago

Was a theory i had as well, but copied whatever was there, and even afterwards ran git submodule init && git submodule update (from the docker install section), but all without luck.