I'm running a GitHub actions workflow that builds and runs a nuxt app for cypress.js testing. I'm receiving a Nuxt Fatal error that I can't seem to figure out from reading the stack when building the app.
FYI, I have looked through EVERY error logged in StackOverflow with this Fatal error but can't seem to find a solution.
Here's my GitHub Actions workflow (everything seems to run OK):
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 }}
And here is the error. I do not understand why there is an error referring to an unresolved path. The path is actually correct. This also runs locally, in a dev server, staging server, and production without any problem:
[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.
Figured it out.
The component was calling "DottedNoteBook" but the file name is "DottedNotebook.vue". (Different case for the letter "B".)
I'm not sure why that case issue never came up before or preventing compiling outside of the GitHub Actions, but that was the issue. Thanks, #Tarkan for making me look closer at that.
Related
hi geeks I am trying to deploy my website through Github pages
so I saw this video that shows me how to deploy the Nextjs website to Github pages.
https://www.youtube.com/watch?v=dalXCXCIPHM
but the build was failed with this error
Failed to compile.
./node_modules/#splinetool/react-spline/dist/react-spline.es.js
Module not found: Can't resolve '#splinetool/runtime' in '/home/runner/work/abdallahzaher2022/abdallahzaher2022/node_modules/#splinetool/react-spline/dist'
Import trace for requested module:
./node_modules/#splinetool/react-spline/dist/react-spline.es.js
./components/WelcomeComp.tsx
> Build failed because of webpack errors
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! abdallahzaher#0.1.0 build: `next build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the abdallahzaher#0.1.0 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/2022-11-24T15_13_56_537Z-debug.log
Error: Process completed with exit code 1.
so I found that problem is with the spline 3d model
I hope there is a solution because the npm run build runs successfully
this is some of my changes that i think it is related
next.config.js
/** #type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
images: {
loader: "akamai",
path: " ",
},
};
module.exports = nextConfig;
package.json
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"export": "next export"
},
and finally this is the workflow file in nodejs config in github pages
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: Node.js CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout#v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node#v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build
- run: npm run export
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action#v4
with:
folder: out # The folder the action should deploy.
Not sure if you've already solved it, but here we go:
So, to debug this, the following information would be required:
Is it deploying correctly on Vercel?
The image 'akamai' loader is usually not required if you deploy on Vercel since they optimize much stuff behind the scenes.
A complete package.json
Suggestion: Use the default Next.js workflow configuration provided by GitHub Pages and see if the error vanishes.
Finally, here's one of my Next.js websites where I've used Spline extensively.
Feel free to use components/SplineObj.js as a template.
Im having trouble deploying my app through GCP Cloud Build.
Do I have to update to GLIBC_2.28 but if so how do I do that on GCP Clould Build?
I'm also assuming it could be the Nodejs version but I specified node 16.15.0 in my cloudbuild.yaml and package.json files... I thought that the problem was only for versions 18x.
In my app.yaml I also use a runtime of Nodejs16.
deploying my application works in the GCP Cloud Shell but I'm having troubles with GCP Cloud Build.
Do you want to continue (Y/n)?
Beginning deployment of service [default]...
╔════════════════════════════════════════════════════════════╗
╠═ Uploading 0 files to Google Cloud Storage ═╣
╚════════════════════════════════════════════════════════════╝
File upload done.
Updating service [default]...
.................................................................................................................................................................................................................................................................................................................................................................................................................................................failed.
ERROR: (gcloud.app.deploy) Error Response: [9] Cloud build 32fb7223-bf43-47ae-bd3b-787ba77c43f0 status: FAILURE
npm ERR! code 1
npm ERR! path /workspace/node_modules/#scarf/scarf
npm ERR! command failed
npm ERR! command sh -c node ./report.js
npm ERR! node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by node)
npm ERR! A complete log of this run can be found in:
npm ERR! /www-data-home/.npm/_logs/2022-07-05T12_26_54_920Z-debug-0.log
Full build logs: https://console.cloud.google.com/cloud-build/builds;region=europe-west1/32fb7223-bf43-47ae-bd3b-787ba77c43f0?project=772319101637
Edit:
Heres my cloudbuild.yaml
steps:
# Install node packages
- name: node:16.15.0
entrypoint: npm
args: ['install']
# Build productive files
- name: node:16.15.0
entrypoint: npm
args: ['run', 'build']
# Deploy to google cloud app egnine
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
entrypoint: 'bash'
args: ['-c', 'gcloud app deploy']
The problem was with my app.yaml file. I switched back to a python27 runtime (which was giving me an issue with files not being found by the handler after building with no problem) but I added a third handler and it works.
runtime: python27
api_version: 1
threadsafe: yes
handlers:
- url: /(.*\.(js|css|svg|png)(|\.map))$
static_files: dist/\1
upload: dist/(.*)(|\.map)
- url: /.*
static_files: dist/index.html
upload: dist/.
- url: /.*
script: auto
secure: always
redirect_http_response_code: 301
skip_files:
- e2e/
- node_modules/
- src/
- ^(.*/)?\..*$
- ^(.*/)?.*\.json$
- ^(.*/)?.*\.md$
- ^(.*/)?.*\.yaml$
- ^LICENSE
Since yesterday I've got this error while running my unit test on github action and I can't figure out why this error happened. Could you help me to solve that ?
> whisper-ui#1.0.0 test
> react-scripts test --coverage --watchAll=false --updateSnapshot
#
# Fatal error in , line 0
# Check failed: !holder_map.has_named_interceptor().
#
#
#
#FailureMessage Object: 0x7ffd7ab08610
1: 0xb691f1 [/opt/hostedtoolcache/node/16.9.0/x64/bin/node]
2: 0x1bf3094 V8_Fatal(char const*, ...) [/opt/hostedtoolcache/node/16.9.0/x64/bin/node]
3: 0x10ac4a1 v8::internal::compiler::JSGlobalObjectRef::GetPropertyCell(v8::internal::compiler::NameRef const&, v8::internal::compiler::SerializationPolicy) const [/opt/hostedtoolcache/node/16.9.0/x64/bin/node]
6: 0x1e61ba3 v8::internal::compiler::JSNativeContextSpecialization::ReduceNamedAccess(v8::internal::compiler::Node*, v8::internal::compiler::Node*, v8::internal::compiler::NamedAccessFeedback const&, v8::internal::compiler::AccessMode, v8::internal::compiler::Node*) [/opt/hostedtoolcache/node/16.9.0/x64/bin/node]
Error: Process completed with exit code 1.
That is the yaml code I wrote for github action
web_test:
name: Web Tests
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x]
steps:
- name: Checkout Code
uses: actions/checkout#v2
- name: Set up Node
uses: actions/setup-node#v2
with:
node-version: 16.x
cache: "npm"
cache-dependency-path: ./web/package-lock.json
- name: Install Dependencies
working-directory: ./web
run: npm install
- name: Lint React Code
working-directory: ./web
run: npm run lint
- name: Run React Tests
working-directory: ./web
run: npm run test
- name: Upload Coverage report to CodeCov
uses: codecov/codecov-action#v1.0.0
with:
# Make sure to add to GitHub secrets!
token: ${{secrets.CODECOV_TOKEN}}
It's an upstream bug in V8 present in node 16.9.0. Until a new release is shipped, please downgrade to 16.8.0
Here's more info about the bug:
https://github.com/nodejs/node/issues/40030
As Grzegorz Uriasz said, this was a node bug introduced in 16.9.0
Since the comment was added, there has been a new node release, fixing the problem https://github.com/nodejs/node/releases/tag/v16.9.1.
Please try using the new version, or if not possible, downgrade to 16.8.0
I've been having some issues installing a scoped package that that was published to GPR
See below for my actions file
name: run unit and coverage tests
on: [push]
jobs:
build:
runs-on: macos-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout#v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node#v1
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://npm.pkg.github.com/'
scope: '#OWNER'
- name: Authenticate with GitHub package registry
run: echo "//npm.pkg.github.com:_authToken=${{ secrets.PRIVATE_ACCESS_TOKEN }}" > ~/.npmrc
- name: npm install, build, and test
run: |
npm ci
npm run test:unit
npm run lint
npm run test:e2e -- --headless
env:
CI: true
my .npmrc file is as follows:
#discoveryedu:registry=https://npm.pkg.github.com/
my private access token has read:packages, write:packages, and repo privileges.
I'm getting the following error in actions:
npm ERR! code E401
npm ERR! 401 Unauthorized - GET https://npm.pkg.github.com/download/#owner/repo/version/hash
i've subbed the owner, repo, and version names for privacy.
I have a very simple config in order to run e2e tests with Cypress using Github Actions in a Nextjs app. When it reaches the npm start command, although it seems to work since it gives the correct output: > Ready on http://localhost:3000, the step stays in pending state without ever advancing to the next step.
Any suggestions on how to fix this?
Following github actions config (.github/workflows/nodejs.yml):
name: Node CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [8.x, 10.x, 12.x]
steps:
- uses: actions/checkout#v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node#v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install, build, and test
run: |
npm ci
npm run build --if-present
npm start
npx wait-on http://localhost:3000
env:
CI: true
- name: Run Cypress
run: |
npx cypress run
env:
CI: true
Using the control operator & works for me. Try the following.
- name: npm install, build, and test
run: |
npm ci
npm run build --if-present
npm start & npx wait-on http://localhost:3000
env:
CI: true
From man bash
If a command is terminated by the control operator &, the shell executes the command in
the background in a subshell. The shell does not wait for the command to finish, and the
return status is 0. These are referred to as asynchronous commands. Commands separated
by a ; are executed sequentially; the shell waits for each command to terminate in turn.
The return status is the exit status of the last command executed.