我正在运行一个GitHub操作工作流,该工作流构建并运行一个用于cypress.js测试的nuxt应用程序。我收到了一个Nuxt致命的错误,我似乎无法从读取堆栈时,构建应用程序。
FYI,我查看了所有登录在StackOverflow中的错误,但似乎找不到解决方案。
下面是我的GitHub操作工作流(一切似乎都运行正常):
name: Cypress run on push
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [14.17.0]
containers: [1, 2, 3, 4, 5]
steps:
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: node -v
- name: Checkout
uses: actions/checkout@v2
- name: Running npm ci (installing dependencies)
run: npm ci
- name: Running npm install
run: npm install
# Update Browserlist
- run: npx browserslist@latest --update-db
- name: Starting test server and running Cypress
uses: cypress-io/github-action@v2
with:
build: npm run build
start: npm run start
wait-on: 'http://localhost:3000/'
wait-on-timeout: 120
record: true
parallel: true
# browser: chrome
# headless: true
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}这是一个错误。我不明白为什么提到未解决的路径时会出现错误。这条路实际上是正确的。这也在本地运行,在开发服务器、暂存服务器和生产中运行,没有任何问题:
[fatal] Nuxt build error
ERROR in ./components/ui/dialogs/SocialMediaWrapper.vue?vue&type=script&lang=js& (./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./components/ui/dialogs/SocialMediaWrapper.vue?vue&type=script&lang=js&)
Module not found: Error: Can't resolve '@/components/svg/DottedNoteBook' in 'components/ui/dialogs'
@ ./components/ui/dialogs/SocialMediaWrapper.vue?vue&type=script&lang=js& (./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./components/ui/dialogs/SocialMediaWrapper.vue?vue&type=script&lang=js&) 200:0-61 203:20-34
@ ./components/ui/dialogs/SocialMediaWrapper.vue?vue&type=script&lang=js&
@ ./components/ui/dialogs/SocialMediaWrapper.vue
@ ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./pages/trial-view/_id.vue?vue&type=script&lang=js&
@ ./pages/trial-view/_id.vue?vue&type=script&lang=js&
@ ./pages/trial-view/_id.vue
@ ./.nuxt/router.js
@ ./.nuxt/index.js
@ ./.nuxt/client.js
@ multi ./.nuxt/client.js
╭─────────────────────────────╮
│ │
│ ✖ Nuxt Fatal Error │
│ │
│ Error: Nuxt build error │
│ │
╰─────────────────────────────╯
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! JurorSearch@2.18.6 build: `nuxt build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the JurorSearch@2.18.6 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2021-08-17T05_30_28_916Z-debug.log
Error: Process completed with exit code 1.发布于 2021-08-20 21:12:21
弄明白了。
组件调用"DottedNoteBook“,但文件名为"DottedNotebook.vue”。(字母“B”的情况不同)
我不知道为什么在GitHub操作之前从来没有出现过这个案例问题,也没有阻止过编译,但这就是问题所在。“谢谢,”塔尔坎让我仔细地看了看。
https://stackoverflow.com/questions/68812228
复制相似问题