wxt-dev / wxt

⚡ Next-gen Web Extension Framework
https://wxt.dev
MIT License
3.28k stars 126 forks source link

init SyntaxError when run `wxt prepare` #743

Closed priority3 closed 3 weeks ago

priority3 commented 3 weeks ago

Describe the bug

there is an error when run wxt prepare

Reproduction

-

Steps to reproduce

just run pnpm dlx wxt@latest init <my-project-name> , select react and pnpm, then pnpm i ; note: This error happened while installing a direct dependency of xx, The latest release of wxt is "0.18.5". (the default release is 0.18.6 ), change the release of wxt in package.json to the latest release 0.18.5 and reinstall, there is an error: SyntaxError: The requested module 'wxt/modules' does not provide an export named 'addImportPreset' image

System Info

windows 10
node v20.10.0
pnpm 9.1.1

Used Package Manager

pnpm

Validations

aklinker1 commented 3 weeks ago

addImportPreset was added in v0.18.6. So you have to use v0.18.6 or higher. Upgrade to the latest version:

pnpm i -D wxt@latest

I'll fix the peer dependency requirement.

priority3 commented 2 weeks ago

addImportPreset was added in v0.18.6. So you have to use v0.18.6 or higher. Upgrade to the latest version:

right, I wanna use v0.18.6 and initial the template as v0.18.6, but the error appears: No matching version found for wxt@^0.18.6, so I change back to v0.18.5

image
priority3 commented 2 weeks ago

addImportPreset was added in v0.18.6. So you have to use v0.18.6 or higher. Upgrade to the latest version:

right, I wanna use v0.18.6 and initial the template as v0.18.6, but the error appears: No matching version found for wxt@^0.18.6, so I change back to v0.18.5

image

it's my bad, just the local cache and registry error;