Skip to content

Inlang removed the entire directory. Please add a condition to prevent this during initialization. #3796

@las-nish

Description

@las-nish

I’m using a Vite + React app, and I added the following config:

import { defineConfig } from "vite";
import { paraglideVitePlugin } from "@inlang/paraglide-js";

export default defineConfig({
  plugins: [
    paraglideVitePlugin({
      project: "./project.inlang",
      outdir: "./", // <--
    }),
  ],
});

I specifically set outdir to './' because Inlang creates the messages inside that directory. I wanted it to generate files inside the root folder, like root/messages, but when I ran the project, the entire directory was wiped out and replaced with inlang-related files.

Caution

I ended up losing three days of work, around 3,000 lines of code.

I really like this library, but I strongly suggest adding a safety check or warning for this scenario to prevent other developers from facing the same issue.

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