Migration from dt-app 0.148.1 to dt-app 1.0.2 error (new project structure)

Hello,

I’ve recently made the dependencies update of my custom app, with in it the new major version of dt-app. In the new version, there is a new project structure files, so I followed the migration guide of the wiki : App toolkit | Dynatrace Developer

When I try to lunch my development app, i’ve got the error that I have the wrong files structure, but I don’t see the problem. I tried to add empty `documents` and `actions` folders, or add a README.md in it but I still have this error :

✖ Building ui...

              Invalid project structure detected

              Your project uses an outdated file structure that is not supported in dt-app v1.0.
              To ensure compatibility and avoid build issues, please update your project structure.

              Required Changes:

              1. Configure sourceRoot in app.config.json:
                • Set "build.sourceRoot" to your desired source directory (default: "./")
                • Example: "build": { "sourceRoot": "src" }

              2. Organize your code using the standardized structure:
                <sourceRoot>/
                ├── ui/                     ← UI components and main.tsx
                │   ├── main.tsx
                │   └── tsconfig.json
                ├── api/                    ← App functions (*.function.ts)
                ├── actions/                ← Workflow actions (*.action.ts)
                ├── settings/               ← Settings widgets and schemas
                └── documents/              ← Document files

              Thank you for your support!

Thanks for your help by advance,

Kind regards,

Evan

PS : I’ve also tried to add the suggested build.sourceRoot option in my app.config.json but doesn’t work

"build": {
    "sourceRoot": "./"
  }

Hi there,

the solution to this problem is to remove every single “src” in your imports in the whole project. If you have an error with a src/ import in, it would return this error (instead of returning import error I guess)

1 Like