Closed re2005 closed 3 years ago
I have the same problem
I have the same problem
The name of the registered component is named PascalCase,not use kebab-case
I too have same problem, I tried PascalCase, kebab-case and path/prefix in nuxt config nothing worked.
it worked once when I tried this in nuxt.config.js
components: ["~/components"],
Temporarily fix to manually import all your global components:
import { Vue } from 'nuxt-property-decorator';
const files = require.context('../components/Globals', true, /\.vue$/);
files.keys().forEach(file => {
const componentConfig = files(file);
const componentName = file.split('/').pop().split('.')[0];
Vue.component(componentName, componentConfig.default || componentConfig);
});
Add to the plugins
plugins: [
'~/plugins/global-component-loader.js',
]
Describe the bug
Seems that the module is not working. It runs fine on development, but when build gets an error:
ERROR render function or template not defined in component: {name} 16:56:44
at Yi (node_modules/vue-server-renderer/build.prod.js:1:67000) at oo (node_modules/vue-server-renderer/build.prod.js:1:70873) at no (node_modules/vue-server-renderer/build.prod.js:1:70523) at wt.to [as renderNode] (node_modules/vue-server-renderer/build.prod.js:1:67770) at wt.next (node_modules/vue-server-renderer/build.prod.js:1:20584) at n (node_modules/vue-server-renderer/build.prod.js:1:18796) at node_modules/vue-server-renderer/build.prod.js:1:68881 at to (node_modules/vue-server-renderer/build.prod.js:1:68889) at node_modules/vue-server-renderer/build.prod.js:1:70990 at eo (node_modules/vue-server-renderer/build.prod.js:1:67480)
To Reproduce Steps to reproduce the behavior:
npm run build npm start
Expected behavior Build normally and importing all components on the specified path.
are you using "@nuxt/typescript-build" in your project or <script lang="ts" in .vue file?
Hi @subodhsj yes I'm using that "@nuxt/typescript-build": "^2.1.0",
and also nuxt-property-decorator
But mind you that was all working fine just a few days ago. The latest update is exactly a few days ago as well.
Hi @subodhsj yes I'm using that
"@nuxt/typescript-build": "^2.1.0",
and alsonuxt-property-decorator
But mind you that was all working fine just a few days ago. The latest update is exactly a few days ago as well.
Thanks @re2005, My other project without @nuxt/typescript-build works fine and Nuxt@v2.15.5 works with typescript.
So @pi0 you have closed this issue, without the confirmation that by just removing @nuxt/typescript-build"
the components
module should works just fine ?
Describe the bug
Seems that the module is not working. It runs fine on development, but when build gets an error:
ERROR render function or template not defined in component: {name} 16:56:44
at Yi (node_modules/vue-server-renderer/build.prod.js:1:67000) at oo (node_modules/vue-server-renderer/build.prod.js:1:70873) at no (node_modules/vue-server-renderer/build.prod.js:1:70523) at wt.to [as renderNode] (node_modules/vue-server-renderer/build.prod.js:1:67770) at wt.next (node_modules/vue-server-renderer/build.prod.js:1:20584) at n (node_modules/vue-server-renderer/build.prod.js:1:18796) at node_modules/vue-server-renderer/build.prod.js:1:68881 at to (node_modules/vue-server-renderer/build.prod.js:1:68889) at node_modules/vue-server-renderer/build.prod.js:1:70990 at eo (node_modules/vue-server-renderer/build.prod.js:1:67480)
To Reproduce Steps to reproduce the behavior:
npm run build npm start
Expected behavior Build normally and importing all components on the specified path.