Open matthew-e-brown opened 2 years ago
I think I ran into this same thing on my first try. At the Windows command line, I got:
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @vitejs/plugin-react@2.0.1
npm WARN Found: vite@2.9.15
npm WARN node_modules/vite
npm WARN optional @vitejs/plugin-react@">=1.2.0" from @crxjs/vite-plugin@1.0.14
npm WARN node_modules/@crxjs/vite-plugin
added 129 packages, and audited 130 packages in 7s
The rest of the messages shown above did not appear. Being new to bundlers and vite, I'm not sure how significant it is, but I gather it is just an annoyance.
@jacksteamdev Note: I was following instructions from the link you e-mailed me, https://dev.to/jacksteamdev/create-a-vite-react-chrome-extension-in-90-seconds-3df7. This article says to use npm init vite@^2
, is that still needed? I see in https://crxjs.dev/vite-plugin/getting-started/vanilla-js/create-project apparently conflicting instructions to use npm init vite@latest
. Not exactly sure which instructions are correct.
looks like the official documentation has been updated to specify vite 2.9 or use the beta crxjs plugin with vite 3.
https://crxjs.dev/vite-plugin/getting-started/vue/create-project
Fixing the docs is good by me.
@willjohnathan I think it is better to use npm init vite@latest
command to initialize your project.
Build tool
Vite
Where do you see the problem?
In the terminal
Describe the bug
465 fixed the peer-deps problem by requiring
vite@^2.9.0
. However, installing@crxjs/vite-plugin
alongside a project withvite@2.9.15
and@vitejs/plugin-vue@2.3.4
(which is the latest version ofplugin-vue
that hasvite@^2.9.0
as one of its peer-deps, instead ofvite@^3.0.0
) still causes warnings.It looks like it comes from
@vitejs/plugin-react
in theoptionalDependencies
of@crxjs/vite-plugin
. Since v1.3.2,@vitejs/plugin-react
has hadvite@^3.0.0
as a peer-dep. Since the semver constraint on@vitejs/plugin-react
is>=1.2.0
,1.3.2
gets installed, causing a warning.I believe setting
@vitejs/plugin-react
to~1.2.0
(until the issues with Vite 3 are resolved) should fix the warnings. Thankfully they're only warnings, this time.I can submit a pull request for this, if that would make things easier.
Reproduction
npm init vite
), and adjust the semver constraints to the latestvite@^2.9.0
-compatible verions:@crxjs/vite-plugin@1.0.14
(latest
).Logs
System Info
Severity
annoyance