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

plugin-legacy Unexpected token import #9297

Closed
7 tasks done
xwnwho opened this issue Jul 22, 2022 · 1 comment · Fixed by #9381
Closed
7 tasks done

plugin-legacy Unexpected token import #9297

xwnwho opened this issue Jul 22, 2022 · 1 comment · Fixed by #9381
Labels
p4-important Violate documented behavior or significantly improves performance (priority) plugin: legacy

Comments

@xwnwho
Copy link

xwnwho commented Jul 22, 2022

Describe the bug

use <img src="@/assets/logo.png"> load static image
build config
legacy({ targets: ['ie >= 11', 'chrome > 49'] })
there will be new URL("logo.03d6d6da.png",import.meta.url).href in legacy chunk file. in chrome 55, import will cause error.

Reproduction

Reproduction

System Info

System:
    OS: Windows 10 10.0.22000
    CPU: (16) x64 AMD Ryzen 7 4800U with Radeon Graphics
    Memory: 5.33 GB / 15.37 GB
  Binaries:
    Node: 16.14.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - C:\Program Files\nodejs\yarn.CMD
    npm: 8.14.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.22000.120.0), Chromium (103.0.1264.62)
    Internet Explorer: 11.0.22000.120
  npmPackages:
    @vitejs/plugin-legacy: ^2.0.0 => 2.0.0
    @vitejs/plugin-vue: ^3.0.1 => 3.0.1
    @vitejs/plugin-vue-jsx: ^2.0.0 => 2.0.0
    vite: ^3.0.2 => 3.0.2

Used Package Manager

pnpm

Logs

No response

Validations

@sapphi-red sapphi-red added plugin: legacy p4-important Violate documented behavior or significantly improves performance (priority) labels Jul 22, 2022
@kishore-rajendran
Copy link

Im facing the same issue @sapphi-red , thanks for fixing it and when will this be merged and meanwhile is there a immediate fix. thanks in advance

@github-actions github-actions bot locked and limited conversation to collaborators Aug 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p4-important Violate documented behavior or significantly improves performance (priority) plugin: legacy
Projects
None yet
3 participants