Skip to content

Project build failed with "import.meta.env" #3304

@WesleyXuZzz

Description

@WesleyXuZzz

Describe the bug

Project build failed

Project build failed with "import.meta.env".If delete the code "import.meta.env", project will build success.

Reproduction

Repo: https://github.com/WesleyXuZzz/vue3-vite-ts-vant3

System Info

  • required vite version: 2.2.2
  • required Operating System: macos 11.3
  • required Node version: 14.16.1

Optional:
Installed vue version (from yarn.lock or package-lock.json) ^3.0.5
Installed @vue/compiler-sfc version ^3.0.5

Logs (Optional if provided reproduction)

[rollup-plugin-dynamic-import-variables] Unexpected token (3:15)
vue3-vite-ts-vant3/src/utils/request.ts:3:15
error during build:
SyntaxError: Unexpected token (3:15)

Metadata

Metadata

Assignees

No one assigned

    Labels

    p2-edge-caseBug, but has workaround or limited in scope (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions