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: Could not resolve webpack #202

Open
4 tasks done
blouflashdb opened this issue Nov 14, 2022 · 5 comments
Open
4 tasks done

ERROR: Could not resolve webpack #202

blouflashdb opened this issue Nov 14, 2022 · 5 comments

Comments

@blouflashdb
Copy link

Reporting a bug?

I am using
import VueI18nVitePlugin from "@intlify/unplugin-vue-i18n/vite";
vite: { resolve: { alias: { "vue-i18n": "vue-i18n/dist/vue-i18n.runtime.esm-bundler.js", }, }, plugins: [ svgLoader(), VueI18nVitePlugin({ include: [ resolve(dirname(fileURLToPath(import.meta.url)), "./locales/*.json"), ], }), ], },

and when I open my App I get an error that webpack is not installed but I am using vite.

Expected behavior

No Error

Reproduction

See code above.

Issue Package

unplugin-vue-i18n

System Info

System:
    OS: Windows 10 10.0.22621
    CPU: (12) x64 AMD Ryzen 5 5500
    Memory: 8.87 GB / 15.90 GB
  Binaries:
    Node: 18.12.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.19.2 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.22621.819.0), Chromium (107.0.1418.42)
    Internet Explorer: 11.0.22621.1
  npmPackages:
    vue-i18n: ^9.2.2 => 9.2.2

Screenshot

No response

Additional context

[vite] error while updating dependencies: 19:31:48
Error: Build failed with 3 errors:
node_modules/@intlify/unplugin-vue-i18n/lib/index.mjs:454:27: ERROR: Could not resolve "webpack"
node_modules/esbuild/lib/main.js:1327:21: ERROR: [plugin: vite:dep-pre-bundle] Failed to resolve entry for package "@intlify/shared". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." entry in "@intlify/shared" package
node_modules/esbuild/lib/main.js:1327:21: ERROR: [plugin: vite:dep-pre-bundle] Failed to resolve entry for package "@intlify/shared". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." entry in "@intlify/shared" package

Validations

  • Read the Contributing Guidelines.
  • Read the README
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A open a GitHub Discussion.
@blouflashdb blouflashdb added the Status: Review Needed Request for review comments label Nov 14, 2022
Copy link
Member

kazupon commented Nov 16, 2022

Thank you for your reporting!

Could you give us minimum reproduction code via GitHub or StackBliz plaese? 🙏

Issue reporting guidline said:

Please provide a link to a repo that can reproduce the problem you ran into. A reproduction is required unless you are absolutely sure that the issue is obvious and the provided information is enough to understand the problem. If a report is vague (e.g. just a generic error message) and has no reproduction, it will receive a "Status: Need More Info" label. If no reproduction is provided after 5 days, it will be closed.

Ref blog article: https://antfu.me/posts/why-reproductions-are-required

@kazupon kazupon added Status: Need More Info Lacks enough info to make progress Package: unplugin-vue-i18n and removed Status: Need More Info Lacks enough info to make progress Status: Review Needed Request for review comments labels Nov 16, 2022 — with Volta.net
@dargmuesli
Copy link

I reproduced the same problem in a larger code base, but were not able to create a minimum reproduction until now.

@phamhongphuc
Copy link

Hi, I also got the same issue when trying to setup my new project with Nuxt 3.
I realized the problem appeared when I tried to combine the following tools:

  • Node: 16x or 18x.
  • Package management:
    • Yarn: both old yarn (1.x) and new yarn (3.x without pnp) get the same error
    • Npm: using npm in Stackblitz gives a different error
  • Nuxt 3 with Vite
  • Vue i18n: unplugin-vue-i18n.
  • TailwindCSS: both official instructions or using @nuxtjs/tailwindcss give me the same error

Both unplugin-vue-i18n and @nuxtjs/tailwindcss work fine alone but when installing both in the repo the issue appears.
The issue only appears when calling nuxt dev but not when calling nuxt build.

This is a minimum reproduction on StackBlitz: https://stackblitz.com/edit/nuxt3-issue-unplugin-vue-i18n

Image

stackblitz com_edit_nuxt3-issue-unplugin-vue-i18n_file=package json

@Dorianslavov
Copy link

Experiencing this issue too. Trying to migrate nuxt 2 project to nuxt 3.
I've also removed @nuxtjs/tailwindcss as above comment suggested but nothing changed.
@kazupon please review this issue as it's a huge blocker which basically makes this unusable

@DeivTorres
Copy link

I have the same issue. Seems to be no news on this :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants