Skip to content

Typescript type autogeneration is done for non typescript projects #19195

@joggienl

Description

@joggienl

Bug report

Required System information

  • Node.js version: 18.14.2
  • NPM version: 9.5.1
  • Strapi version: 4.17.0
  • Database: sqlite3
  • Operating system: macOS 14.2.1
  • Is your project Javascript or Typescript: Javascript

Did you know you can run yarn strapi report or npm run strapi report to get this information easier?

No, but it does not tell if you are using TS or JS.

Describe the bug

The typescript types will be auto generated under types/generated .

Steps to reproduce the behavior

npx create-strapi-app@4.17.0 --quickstart --no-run new-strapi-project
cd new-strapi-project

# note that npx create-strapi-app uses yarn to install your deps! Does not matter for the next step.

npm run develop

At this point, stop the server and if you look in the root of the new-strapi-project you can see a folder types.

If you create a file to disable the autogeneration as described on https://docs.strapi.io/dev-docs/configurations/typescript#strapi-specific-configuration-for-typescript that does not make any difference.

Expected behavior

  • No typescript types generated for javascript projects
  • If you have autogenerate set to false the types should not be generated!

Screenshots

If applicable, add screenshots to help explain your problem.

Code snippets

If applicable, add code samples to help explain your problem.

Additional context

This issue is similar: #18124
The issue should probably be tracked in: #15225

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions