You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to write a vue component library that will work in nuxt and vue.
The issue i was originally having was document is not defined when using Extract CSS. from reading, i understand the css-loader webpack settings need to be adjusted to use a different module (one that isnt using document).
//pkge/index.js
// Used to create imports for vue component library
import * as components from '@/components'
const install = (Vue, options = {}) => {
// Use Components
Object.values(components).forEach(comp => {
Vue.use(comp)
})
}
// auto install
if (typeof window !== 'undefined' && window.Vue) {
install(window.Vue)
}
export default { install }
export * from '@/components'
What is expected?
Extract CSS using webpack module so it is client and server ready
What is actually happening?
error in ./components/layout/row.vue?vue&type=style&index=0&id=08898866&scoped=true&lang=css&
Module build failed (from ./node_modules/@vue/cli-service/node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
Error: Didn't get a result from child compiler
at childCompiler.runAsChild (B:\lib\node_modules\mini-css-extract-plugin\dist\loader.js:159:23)
at compile (B:\lib\node_modules\webpack\lib\Compiler.js:343:11)
at hooks.afterCompile.callAsync.err (B:\lib\node_modules\webpack\lib\Compiler.js:681:15)
at AsyncSeriesHook.eval [as callAsync] (eval at create (B:\lib\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:24:1)
at AsyncSeriesHook.lazyCompileHook (B:\lib\node_modules\tapable\lib\Hook.js:154:20)
at compilation.seal.err (B:\lib\node_modules\webpack\lib\Compiler.js:678:31)
at AsyncSeriesHook.eval [as callAsync] (eval at create (B:\lib\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:6:1)
at AsyncSeriesHook.lazyCompileHook (B:\lib\node_modules\tapable\lib\Hook.js:154:20)
at hooks.optimizeAssets.callAsync.err (B:\lib\node_modules\webpack\lib\Compilation.js:1423:35)
at AsyncSeriesHook.eval [as callAsync] (eval at create (B:\lib\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:6:1)
at AsyncSeriesHook.lazyCompileHook (B:\lib\node_modules\tapable\lib\Hook.js:154:20)
at hooks.optimizeChunkAssets.callAsync.err (B:\lib\node_modules\webpack\lib\Compilation.js:1414:32)
at _promise0.then._result0 (eval at create (B:\lib\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:13:1)
at process._tickCallback (internal/process/next_tick.js:68:7)
at runLoaders (B:\lib\node_modules\webpack\lib\NormalModule.js:316:20)
at B:\lib\node_modules\loader-runner\lib\LoaderRunner.js:367:11
at B:\lib\node_modules\loader-runner\lib\LoaderRunner.js:182:20
at context.callback (B:\lib\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
at childCompiler.runAsChild (B:\lib\node_modules\mini-css-extract-plugin\dist\loader.js:159:14)
at compile (B:\lib\node_modules\webpack\lib\Compiler.js:343:11)
at hooks.afterCompile.callAsync.err (B:\lib\node_modules\webpack\lib\Compiler.js:681:15)
at AsyncSeriesHook.eval [as callAsync] (eval at create (B:\lib\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:24:1)
at AsyncSeriesHook.lazyCompileHook (B:\lib\node_modules\tapable\lib\Hook.js:154:20)
at compilation.seal.err (B:\lib\node_modules\webpack\lib\Compiler.js:678:31)
at AsyncSeriesHook.eval [as callAsync] (eval at create (B:\lib\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:6:1)
at AsyncSeriesHook.lazyCompileHook (B:\lib\node_modules\tapable\lib\Hook.js:154:20)
at hooks.optimizeAssets.callAsync.err (B:\lib\node_modules\webpack\lib\Compilation.js:1423:35)
at AsyncSeriesHook.eval [as callAsync] (eval at create (B:\lib\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:6:1)
at AsyncSeriesHook.lazyCompileHook (B:\lib\node_modules\tapable\lib\Hook.js:154:20)
at hooks.optimizeChunkAssets.callAsync.err (B:\lib\node_modules\webpack\lib\Compilation.js:1414:32)
How can i configure it to use the weback module correctly?
The text was updated successfully, but these errors were encountered:
Hi, thanks for your interest but Github issues are for bug reports and feature requests only. You can ask questions on the forum, the Discord server or StackOverflow.
This might be a fix to what you are seeing: #11609
Hi, thanks for your interest but Github issues are for bug reports and feature requests only. You can ask questions on the forum, the Discord server or StackOverflow.
This might be a fix to what you are seeing: #11609
This is for vue-ssr where the vue app is being loaded using the '.json`. However, i want to create a component library. vue.txt
Version
2.6.11
Reproduction link
https://github.com/mjmnagy/vue-error-2020-08-26
Steps to reproduce
I am trying to write a
vue
component library that will work innuxt
andvue
.The issue i was originally having was
document is not defined
when usingExtract CSS
. from reading, i understand thecss-loader
webpack settings need to be adjusted to use a different module (one that isnt usingdocument
).I have downloaded(npm) the new webpack module(https://webpack.js.org/plugins/mini-css-extract-plugin/) and copied in the example code without any luck.
The below is an example of the error i get for every component
I have been looking on the interweb for hours now and cannot seem to find a solution.
I have been looking at the
API Docs
https://ssr.vuejs.org/guide/build-config.html#server-config and cannot seem to find something that works. Additionally i tied deletingnode_modules
//package.json
"prod": "vue-cli-service build --report --target lib --name sc pkge/index.js",
run via
npm run prod
//vue.config.js
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
export default { install }
export * from '@/components'
What is expected?
Extract CSS using webpack module so it is client and server ready
What is actually happening?
The text was updated successfully, but these errors were encountered: