Skip to content

import.meta.env.DEV env always true when using content collections feature #5625

@fflaten

Description

@fflaten

What version of astro are you using?

1.7.1

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

npm

What operating system are you using?

Linux

Describe the Bug

When the new content collections feature is enabled, import.meta.env.DEV is always true.
Using astro build:

  • import.meta.env.MODE === 'production'
  • import.meta.env.DEV === true

Setting contentCollections to false + rebuild fixes it.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-2gq6bf?file=astro.config.mjs

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

Labels

- P3: minor bugAn edge case that only affects very specific usage (priority)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions