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

Webpack configuration issue: Did you miss the leading dot in 'resolve.extensions'? #3380

Open
czuniga9 opened this issue Dec 27, 2023 · 0 comments

Comments

@czuniga9
Copy link

  • Laravel Mix Version: 6.0.49 (npm list --depth=0)
  • Node Version (node -v): v18.19.0
  • NPM Version (npm -v): 10.2.3
  • OS: macOS 14.2.1

Description:

After upgrading webpack to version 5.89.0 I started getting this error:

ERROR in ../../vendor/laravel/nova/resources/js/mixins/PreventsFormAbandonment.js 8:0-45
Module not found: Error: Can't resolve '@inertiajs/inertia' in '/Users/my_user/my_website/vendor/laravel/nova/resources/js/mixins'
Did you miss the leading dot in 'resolve.extensions'? Did you mean '[".*",".wasm",".mjs",".js",".jsx",".json",".vue",".*"]' instead of '["*",".wasm",".mjs",".js",".jsx",".json",".vue",".*"]'?

The issue seems to be in the file src/builder/webpack-default.js#L32, the extensions configuration expects them to have a leading dot:

        resolve: {
-            extensions: ['*', '.wasm', '.mjs', '.js', '.jsx', '.json'],
+            extensions: ['.*', '.wasm', '.mjs', '.js', '.jsx', '.json'],
            roots: [path.resolve(mix.config.publicPath)]
        },

This seems to be a check that webpack added some time ago: webpack/webpack#16807

Steps To Reproduce:

  • Upgrade webpack to the latest version
  • Run npm run dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant