Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while upgrading from v5 to v6 #19021

Closed
7 tasks done
harshmangalam opened this issue Dec 20, 2024 · 2 comments
Closed
7 tasks done

Error while upgrading from v5 to v6 #19021

harshmangalam opened this issue Dec 20, 2024 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@harshmangalam
Copy link

Describe the bug

I have upgrade the vite from v5 to v6 and run the dev server it shows me error.

Reproduction

N/A

Steps to reproduce

My Vite config

import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
import svgr from "vite-plugin-svgr";
// https://vitejs.dev/config/
export default defineConfig({
  base: "/",
  plugins: [react(), svgr()],
  envPrefix: ["REACT_APP"],
});

System Info

System:
    OS: macOS 15.1.1
    CPU: (8) arm64 Apple M1
    Memory: 124.94 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.13.1 - ~/.nvm/versions/node/v20.13.1/bin/node
    Yarn: 1.22.22 - ~/.nvm/versions/node/v20.13.1/bin/yarn
    npm: 10.5.2 - ~/.nvm/versions/node/v20.13.1/bin/npm
    pnpm: 9.14.2 - ~/.nvm/versions/node/v20.13.1/bin/pnpm
    bun: 1.1.0 - /opt/homebrew/bin/bun
  Browsers:
    Chrome: 131.0.6778.205
    Safari: 18.1.1

Used Package Manager

pnpm

Logs

✘ [ERROR] Expected identifier but found "import"

(define name):1:0:
  1 │ import.meta.dirname
    ╵ ~~~~~~

✘ [ERROR] Expected identifier but found "import"

(define name):1:0:
  1 │ import.meta.filename
    ╵ ~~~~~~

✘ [ERROR] Expected identifier but found "import"

(define name):1:0:
  1 │ import.meta.url
    ╵ ~~~~~~

Validations

@ananduremanan
Copy link

Does downgrading the version fix this?

@sapphi-red
Copy link
Member

Duplicate of #19018

@sapphi-red sapphi-red marked this as a duplicate of #19018 Dec 20, 2024
@sapphi-red sapphi-red closed this as not planned Won't fix, can't repro, duplicate, stale Dec 20, 2024
@sapphi-red sapphi-red added duplicate This issue or pull request already exists and removed pending triage labels Dec 20, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jan 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants