nuxt (Bootstrap Vue) - The "path" argument must be of type string
See original GitHub issue- Operating System: Win10
- Node Version: 10.16.0
- NPM Version: 6.9.0
- webpack Version: 4
- mini-css-extract-plugin Version: 0.7.0
I hate to report this as a bug as it’s likely something I just do not have properly configured but this issue only arises when I include MiniCssExtractPlugin in my plugins
Expected Behavior
plugin extracts CSS into separate files
Actual Behavior
i Preparing project for development i Initial build may take a while √ Builder initialized
ERROR The “path” argument must be of type string. Received type undefined
at validateString (internal/validators.js:125:11) at Object.extname (path.js:830:5) at uniqBy_1.options.plugins.map (node_modules@nuxt\builder\dist\builder.js:5671:58) at Array.map (<anonymous>) at Builder.normalizePlugins (node_modules@nuxt\builder\dist\builder.js:5667:28) at Builder.generateRoutesAndFiles (node_modules@nuxt\builder\dist\builder.js:5640:36) at Builder.build (node_modules@nuxt\builder\dist\builder.js:5575:16)
Code
https://gist.github.com/jeffster9/2562288df68fbe672933a40258312f5d
How Do We Reproduce?
# npx create-nuxt-app mini-css-extract-plugin-test
? Project name mini-css-extract-plugin-test
? Project description test mini-css-extract-plugin
? Author name author
? Choose the package manager Npm
? Choose UI framework Bootstrap Vue < not sure if this is the issue?
? Choose custom server framework None (Recommended)
? Choose Nuxt.js modules Axios
? Choose linting tools eslint
? Choose test framework None
? Choose rendering mode Universal (SSR)
add mini-css-extract-plugin to nuxt.config.js
# npm run dev
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Here’s a repo of an installation following the reproduction steps outlined above: https://github.com/jeffster9/test-mini-css-extract-plugin
All I did was install Nuxt (w/ Bootstrap Vue as the framework), tested (successfully), installed mini-css-extract-plugin and tested again, receiving the error “The “path” argument must be of type string…”
I don’t doubt that it’s due to a configuration adjusted by Nuxt but I have searched the web for an answer and haven’t been able to resolve the issue. All the other plugins I use work without issue, though. So, I’m finally resorting to reporting this to your team in hopes that you can explain why this is occurring.
I appreciate you looking into it and am looking forward to including this plugin in my project. The strange thing is that is is the plugin presented by Nuxt for this task; so, you’d think it’d work right “out of the box.” Anyway, thanks in advance.
It was my mistake. I was adding directly with the Nuxt config and not adding to the build section in the Nuxt config as seen here https://nuxtjs.org/faq/webpack-plugins/. 😕 facepalm