问题
我使用nuxt1.4进行路由,使用Jest进行单元测试。我的应用程序不会抛出错误,而且看起来工作得很好。然而,当运行我的单元测试npm run unit (运行玩笑)时,它会在终端[Vue warn]: Unknown custom element: <nuxt-link> - did you register the component correctly? For recursive components, make sure to provide the "name" option.中抛出一个错误。
期望
我希望它不会抛出这个错误,因为我的应用程序正在工
在我的nuxt应用程序中,在使用this.$router.push({ path: '/path' })改变路由后,我在火狐中获得了nodeOps.tagName(...) is undefined,在chrome中我得到了cannot get access to .toLowerCase() of undefined。
它发生在createPatchFunction of vue.runtime.esm.js版本:nuxt:^2.14.12, vue:^2.6.12中。
function createPatchFunction (backend) {
// ...
/
我正在构建一个nuxt应用程序,每当我运行build命令时,我就会得到css与无效选项对象相关的错误。
ERROR in ./node_modules/vue2-google-maps/dist/components/streetViewPanorama.vue (./node_modules/@nuxt/webpack/node_modules/css-loader/dist/cjs.js?minimize!./node_modules/vue-loader/lib/style-compiler?{"optionsId":"0","vue":t
如何在Nuxt中使用jest对仅包含布局的Vue SFC页面进行快照测试。例如: <script>
export default {
layout: 'some-layout-name'
};
</script> 我得到一个错误,因为它缺少模板部分,我无法让它在jest的快照测试中生成快照。 [Vue warn]: Failed to mount component: template or render function not defined.
found in
---> <Ano
我有一些img标记,我用require填充它的动态地址,它在组件中按预期工作,但是当我为它编写测试时,它会抛出这个错误。
console.error
Error: Configuration error:
Could not locate module ~/assets/images/flags/undefined.png mapped as:
/home/user/Desktop/Workspace/porject/$1.
Please check your configuration for these entries:
{
我重新安装了Nuxt.js和bootstrap-vue/nuxt模块,并将其正确地添加到nuxt.config.js中。但是现在,当我将像<v-btn text>foo</v-btn>这样的元素添加到索引页面时,我在javascript控制台中得到了以下错误消息:
[Vue warn]: Unknown custom element: <v-btn> - did you register the component correctly? For recursive components, make sure to provide the "name&
在我的jest测试中,我需要导入测试组件需要工作的所有内容(在我的应用程序的main.js中这样做)。因为我有多个测试文件,我需要在每个文件中“重新导入”它。是否有一种方法将其全部导入到单个文件中,然后只导入此文件?
import Component from '@/views/input-something'
import {mount, shallowMount} from '@vue/test-utils'
import {FontAwesomeIcon} from '@fortawesome/vue-fontawesome'
import
首先,我的配置是:
nuxt.config.ts
import { defineNuxtConfig } from 'nuxt'
export default defineNuxtConfig({
// if you want to use static HTML generation (SSG)
target: 'static',
// if you want to use server-side rendering (SSR)
ssr: true,
css: [
'assets/scss/
当我尝试在我的nuxt 3应用程序中呈现这个字体很棒的组件时,我得到了下面的错误,所有npm安装都是正确的,并且不能在没有任何错误的情况下获得应用中的图标。
at WeakMap.set (<anonymous>)
at normalizePropsOptions (./node_modules/@vue/runtime-core/dist/runtime-core.cjs.js:3966:11)
at createComponentInstance (./node_modules/@vue/runtime-core/dist/runtime-core.cjs.
我的Nuxt.js网站有问题。我定义了一个页面,其中包含一个动态的段塞参数,如下所示:
/solutions/:slug
如果我在浏览器中直接访问该页面,它将正确加载!但是,如果我在NavBar组件中单击nuxt链接,就会在控制台中得到以下错误,并且页面不会加载:
vue.runtime.esm.js?2b0e:619
[Vue warn]: Failed to mount component: template or render function not defined.
found in
---> <Anonymous>
<Nuxt>
nuxt: 2.15.8
node: v16.14.2
我已经开发了七个多月了,我想知道它对其他人是否正常。因为我觉得每次刷新之前都非常慢,特别是在使用TailwindCSS开发时,它比等待它响应要慢。
我使用SSR和WSL2,我认为它不是来自WSL2和Docker,因为它的api非常快。
page response time: 3-6s sometimes 7-10s its very slow
dev build client: 8-30s
dev build server: 9-35s
我的档案
In folder pages: 40+
In folder components: 60
我在TypeScript中使用Jest 27.5.1。当我尝试测试时,我得到了以下错误:
● Test suite failed to run
TypeError: Cannot read properties of undefined (reading 'extend')
2 | <div>Hello</div>
3 | </template&g
我正在尝试从一个我一直在做的nuxtJs项目中导出dist文件夹。当我在本地机器上使用npm run dev命令运行项目时,一切正常,但当我尝试运行npm run generate或npm run build时,会显示以下错误 ERROR in ./layouts/default.vue 22:83
Module parse failed: Unexpected token (22:83)
File was processed with these loaders:
* ./node_modules/@nuxt/components/dist/loader.js
* ./node_mod
我在VS代码中使用Nuxt 2.15.7,使用Node版本14.17.1和eslint扩展。
问题
我开始在每个文件的第一个字符下面看到一条红色的线条。在它上方盘旋时,我看到的是这样的错误:
require() of ES modules is not supported.
require() of C:\Users\SR Gears\Documents\work\my-website\node_modules\eslint\node_modules\eslint-scope\lib\definition.js
from C:\Users\SR Gears\Documents\work\my
我目前正在使用Jest测试一个使用Vuex和Vuetify的Vue项目。当在任何组件上测试某些东西时,它会给我一堆这种性质的错误: console.error node_modules/vue/dist/vue.runtime.common.dev.js:621
[Vue warn]: Error in created hook: "TypeError: Cannot read property 'dispatch' of undefined"
found in
---> <DashboardSlots>
<Statu