Skip to content

[create-app]: Fail to use import.meta.env in cjs format (Storybook) #588

@adamsoderstrom

Description

@adamsoderstrom

Get this when trying to run pnpm build in a fresh monorepo setup.

"import.meta" is not available with the "cjs" output format and will be empty
{
  column: 19,
  file: '/Users/adamsoderstrom/Documents/NoA/Projects/pralecta/apps/docs/.stor
ybook/main.ts',
  length: 11,
  line: 10,
  lineText: "  const resolved = import.meta.resolve(join(value, 'package.json'
))",
  namespace: '',
  suggestion: ''
}

Node v24

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