Skip to content

Can't build app from source. app-lib: env variable 'modrinth_**' not defined at compile time #5042

@FallenVEye

Description

@FallenVEye

Please confirm the following.

  • I checked the existing issues for duplicate problems
  • I have tried resolving the issue using the support portal
  • I have ensured my Modrinth App installation is up to date

What version of the Modrinth App are you using?

The current main HEAD(f303395), also v0.10.23

What operating systems are you seeing the problem on?

Linux

Describe the bug

Compiling of the app-lib fails during pnpm app:dev with error:

error: environment variable `MODRINTH_API_URL` not defined at compile time
   --> packages/app-lib/src/state/cache.rs:946:21
    |
946 |                     env!("MODRINTH_API_URL"),
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: use `std::env::var("MODRINTH_API_URL")` to read the variable at run time

    Building [=======================> ] 799/806: tauri-plugin-fs, theseus, tauri, tauri-plugin-updater 

Running cargo build for app-lib leads to the same issue. It only compiles if i export those variables in the shell, but it doesn't work for app:dev

Steps to reproduce

  1. Get the fresh repo
  2. Run pnpm install (works fine)
  3. Run pnpm app:dev

Expected behavior

No response

Additional context

OS: Arch Linux x86_64
node: v22.17.0
pnpm: 10.24.0
rustc: 1.88.0
Tauri: 2.7.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    appRelates to Modrinth App

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions