+
Skip to content

vitest : angular : No platform exists! #1799

Closed
@memory660

Description

@memory660

Please provide the environment you discovered this bug in.

I think I found the origin of the problem: "no platform exist"
This only concerns projects using modules
main.ts

platformBrowser()
  .bootstrapModule(ModulexModule)
  .catch((err) => console.error(err));

vite.config.mts

...
      server: {
        deps: {
          inline: ["@angular/core"],
        },
      },
...
  • when i adding inline: ["@angular/core"], ----> "no platform exist" appear on vitest run
  • if I don't put this line then vites fails and asks me to put it
  • I started from an empty project and I noticed this

Angular 20

angular-vitest-new-brandon.zip
npm i
npm run test:vitest:ui

Which area/package is the issue in?

vite-plugin-angular

Description

No platform exists!

Please provide the exception or error you saw


Other information

No response

I would be willing to submit a PR to fix this issue

  • Yes
  • No

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载