Unable to build VueJS project in Azure Pipeline build - azure

I have a large .NET website solution that has more than 30 projects in it, with some of them including VueJS. We have no problem building in any development environment, once we install all of the dependencies. However, Azure Pipeline is another thing...
The solution includes legacy webforms, MVC, DLL library, and the Vue projects (that are also webforms/core/mvc).
How can we adjust our Azure Pipeline to build the client apps the same way that local instances of Visual Studio does/can?
We can just build in debug/release mode without issue, by including the following commands in the build commands (in the project file, or included MSBuild script).
<Target Name="BuildVueClientApp">
<Message Text="Performing VueJS build." Importance="high"></Message>
<CreateItem Include="$(FullModulePath)\Scripts\client-app\**;">
<Output TaskParameter="Include" ItemName="deleteVueFiles" />
</CreateItem>
<Delete ContinueOnError="true" Files="#(deleteVueFiles)"></Delete>
<Exec Condition="$(Configuration) == 'Debug'" Command="npm run build-dev" />
<Exec Condition="$(Configuration) == 'Release'" Command="npm run build --prod" />
</Target>
I'm very new to Azure Pipelines, so please be descriptive. :)
Here is our current script:
trigger:
- development
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln;-:**\Examples*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller#1
- task: NuGetCommand#2
inputs:
restoreSolution: '$(solution)'
- task: VSBuild#1
inputs:
solution: '$(solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:BuildInParallel=true /p:PackageLocation="$(build.artifactStagingDirectory)"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: VSTest#2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
Here is the package.json, just in case you need to know it.
{
"name": "client-app",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"build-dev": "vue-cli-service build --mode development",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.6.4",
"vue": "^2.6.11"
},
"devDependencies": {
"#vue/cli-plugin-babel": "~4.3.0",
"#vue/cli-plugin-eslint": "~4.3.0",
"#vue/cli-service": "~4.3.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"vue-template-compiler": "^2.6.11"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {
"no-fallthrough": "off",
"no-undef": "warn",
"no-unused-vars": "warn"
}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
If I need to provide any additional details to help you create an answer, please let me know. :)

Related

error TS2307: Cannot find module or its corresponding type declarations. on Github Actions

I can't find a way to fix this. It is working locally as usual. I have tried using path aliases, relative paths, updating the yaml file many times, but can't find it to work.
The gihub actions spits this
Run yarn build yarn run v1.22.19 warning package.json: No license field $ tsc Error: src/application/Feed/Activity/AddActivity.handler.ts(7,37): error TS2307: Cannot find module '#domain/Feed/Activity/Dto/Activity.response.dto' or its corresponding type declarations. Error: src/domain/Feed/Activity/Activity.mapper.ts(2,37): error TS2307: Cannot find module './Dto/Activity.response.dto' or its corresponding type declarations. Error: src/infrastructure/Serverless/Controller/Feed/Activity/AddActivity.controller.ts(4,37): error TS2307: Cannot find module '#domain/Feed/Activity/Dto/Activity.response.dto' or its corresponding type declarations. Error: src/infrastructure/Serverless/GetStream/Feed/Activity/Mapper/Activity.mapper.ts(6,37): error TS2307: Cannot find module '#domain/Feed/Activity/Dto/Activity.response.dto' or its corresponding type declarations. error Command failed with exit code 2. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. Error: Process completed with exit code 2.
this is my config
name: APP_NAME
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
build_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout#v3
with:
persist-credentials: false
- uses: actions/setup-node#v3
with:
node-version: lts/*
cache: yarn
- name: install
run: yarn --immutable
- name: build
run: yarn build
- name: Install B4A Cli
run: curl https://raw.githubusercontent.com/back4app/parse-cli/back4app/installer.sh | /bin/bash
- name: Configure B4A Cli and set it default
run: echo $ACCOUNT_KEY | b4a configure accountkey && b4a default $APP_NAME
- name: Deploy
run: b4a deploy
Package.json
{
"description": "",
"main": "src/main.js",
"scripts": {
"lint": "eslint src/",
"test": "jest",
"build": "tsc",
"dev:parse": "mongodb-runner start && parse-server --appId 'APP' --masterKey 'MASTER' --clientKey 'CLIENT' --databaseURI mongodb://localhost/test --cloud ./cloud/main.js",
"debug:parse": "mongodb-runner start && parse-server --appId 'APP' --masterKey 'MASTER' --clientKey 'CLIENT' --databaseURI mongodb://localhost/test --cloud ./cloud/main.js --verbose",
"dev:dash": "parse-dashboard --dev --appId APPLICATION_ID --masterKey MASTER_KEY --serverURL http://localhost:1337/parse --appName MY_APP"
},
"devDependencies": {
"#types/jest": "^29.2.3",
"#types/node": "^18.11.9",
"#types/node-fetch": "^2.6.2",
"#types/parse": "^3.0.1",
"#types/uuid": "^8.3.4",
"#typescript-eslint/eslint-plugin": "^5.42.1",
"#typescript-eslint/parser": "^5.42.1",
"eslint": "^8.27.0",
"jest": "^29.3.1",
"ts-jest": "^29.0.3",
"ts-node": "^10.9.1",
"typescript": "^4.8.4"
},
"dependencies": {
"class-transformer": "^0.5.1",
"class-validator": "^0.13.2",
"getstream": "^8.1.0",
"module-alias": "^2.2.2",
"parse-server": "^5.3.3",
"reflect-metadata": "^0.1.13",
"tsyringe": "^4.7.0",
"uuid": "^9.0.0"
},
"_moduleAliases": {
"#root": "cloud/",
"#domain": "cloud/domain",
"#application": "cloud/application",
"#infrastructure": "cloud/infrastructure"
}
}
tsconfig.json
{
"compilerOptions": {
"lib": ["es6"],
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"target": "ES2022",
"module": "commonjs",
"moduleResolution": "node",
"rootDir": "src/",
"baseUrl": ".",
"paths": {
"#root/*": ["./src/*"],
"#domain/*": ["./src/domain/*"],
"#application/*": ["./src/application/*"],
"#infrastructure/*": ["./src/infrastructure/*"],
},
"outDir": "cloud",
"removeComments": true,
"isolatedModules": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": false,
"forceConsistentCasingInFileNames": true,
"strict": true,
"strictPropertyInitialization": false,
"alwaysStrict": true,
"skipLibCheck": true
},
"include": ["src/"],
"exclude": ["src/**/*.spec.ts", "cloud", "node_modules"]
}
I have tried changing the github actions yaml config, switching from relative paths to path aliases, but can't make it work.
Delete node_modules folder and run npm install. Hope this will work

CI/CD for NextJs applications fails in Github Actions

this is my first question here :D
I'm setting up the CI/CD process for a NextJS application and everything is working fine locally but when I try to run the workflow in Github Actions the command npm run build fails. It says that it can't find the babel-plugin-styled-components package, but the package is there.
package.json
{
"name": "some-name",
"version": "0.1.1",
"private": true,
"scripts": {
"dev": "next dev -p 15002",
"build": "next build",
"start": "NODE_ENV=production node server.js"
},
"dependencies": {
"babel-plugin-transform-runtime": "6.23.0",
"dyte-client": "^0.34.0",
"express": "^4.17.1",
"jspdf": "^2.5.1",
"leaflet": "^1.7.1",
"next": "^11.1.2",
"nprogress": "^0.2.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-fade-in": "^2.0.1",
"react-leaflet": "^3.2.2",
"react-leaflet-enhanced-marker": "^1.0.21",
"react-reveal": "^1.2.2",
"react-simple-maps": "^2.3.0",
"react-slick": "^0.28.1",
"react-truncate": "^2.4.0",
"reactn": "^2.2.7",
"sass": "^1.44.0",
"sharp": "^0.29.3",
"sitemap": "^7.0.0",
"slick-carousel": "^1.8.1",
"timezones-list": "^3.0.1"
},
"dependenciesLocal": {
"babel-plugin-transform-runtime": "6.23.0",
"dyte-client": "^0.34.0",
"express": "^4.17.1",
"leaflet": "^1.7.1",
"next": "^11.1.2",
"nprogress": "^0.2.0",
"react-fade-in": "^2.0.1",
"react-leaflet": "^3.2.2",
"react-leaflet-enhanced-marker": "^1.0.21",
"react-reveal": "^1.2.2",
"react-slick": "^0.28.1",
"react-truncate": "^2.4.0",
"reactn": "^2.2.7",
"sass": "^1.44.0",
"sitemap": "^7.0.0",
"slick-carousel": "^1.8.1"
},
"devDependencies": {
"#typescript-eslint/eslint-plugin": "^4.23.0",
"#typescript-eslint/parser": "^4.23.0",
"babel-eslint": "^10.1.0",
"babel-plugin-styled-components": "^1.12.0",
"delegates": "^1.0.0",
"eslint": "^7.26.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-prettier": "^8.3.0",
"eslint-config-react-app": "^6.0.0",
"eslint-plugin-flowtype": "^5.7.2",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-react": "^7.23.2",
"eslint-plugin-react-hooks": "^4.2.0",
"typescript": "^4.2.4",
"webpack": "^5.57.1"
},
"engines": {
"node": "14.x"
}
}
deploy.yml
name: Staging deployment
on:
push:
branches:
- "staging"
permissions:
id-token: write
contents: read
env:
SOME_ENV_VARS: SOME_VALUE
jobs:
build:
name: CI Pipeline
runs-on: ubuntu-latest
environment: staging
strategy:
matrix:
node-version: ["14.x"]
steps:
- name: Checkout the files
uses: actions/checkout#v2
- name: Setup node ${{ matrix.node-version }}
uses: actions/setup-node#v2
with:
node-version: ${{ matrix.node-version }}
# Install project dependencies, test and build
- name: Install dependencies
run: npm install
env:
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Run build
run: npm run build
env:
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
CI: false
deploy:
name: CD Pipeline
runs-on: ubuntu-latest
environment: staging
needs: [build]
strategy:
matrix:
node-version: ["14.x"]
appname: ["main_app"]
deploy-group: ["main_app_staging"]
s3-bucket: ["main-app-codedeploy-staging"]
s3-filename: ["main-app-codedeploy-staging-${{ github.sha }}"]
steps:
- name: Setup repository
uses: actions/checkout#v2
- name: Setup node ${{ matrix.node-version }}
uses: actions/setup-node#v2
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install
env:
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Run build
run: npm run build
env:
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
CI: false
# Configure AWS credentials
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials#v1
with:
role-to-assume: ${{ secrets.AWS_DEPLOY_ROLE }}
role-session-name: OIDCSession
aws-region: ${{ secrets.AWS_REGION }}
# Deploy push to AWS S3
- name: AWS Deploy push
run: |
aws deploy push \
--application-name ${{ matrix.appname }} \
--description "This is a revision for the ${{ matrix.appname }}-${{ github.sha }}" \
--ignore-hidden-files \
--s3-location s3://${{ matrix.s3-bucket }}/${{ matrix.s3-filename }}.zip \
--source .
# Create deployment to CodeDeploy
- name: AWS Create Deployment
run: |
aws deploy create-deployment \
--application-name ${{ matrix.appname }} \
--deployment-config-name CodeDeployDefault.OneAtATime \
--deployment-group-name ${{ matrix.deploy-group }} \
--file-exists-behavior OVERWRITE \
--s3-location bucket=${{ matrix.s3-bucket }},key=${{ matrix.s3-filename }}.zip,bundleType=zip \
The error
./node_modules/next/dist/client/next.js
Error: Cannot find module 'babel-plugin-styled-components'
Require stack:
- /home/runner/work/adplist/adplist/node_modules/next/dist/compiled/babel/bundle.js
- /home/runner/work/adplist/adplist/node_modules/next/dist/compiled/babel/code-frame.js
- /home/runner/work/adplist/adplist/node_modules/next/dist/build/webpack-config.js
- /home/runner/work/adplist/adplist/node_modules/next/dist/build/index.js
- /home/runner/work/adplist/adplist/node_modules/next/dist/cli/next-build.js
- /home/runner/work/adplist/adplist/node_modules/next/dist/bin/next
- If you want to resolve "styled-components", use "module:styled-components"
at loadPlugin.next (<anonymous>)
at createDescriptor.next (<anonymous>)
at Array.map (<anonymous>)
at Generator.next (<anonymous>)
> Build error occurred
Error: > Build failed because of webpack errors
EDIT 1: Here is the babel file.
{
"presets": ["next/babel"],
"plugins": [
[
"styled-components",
{ "ssr": true, "displayName": true, "preprocess": false }
]
],
"compact": false
}
Hope you can help me! :)

Node App builds locally but fails in GitlabCI

I have a svelte app that is built with SvelteKit. It runs fine locally and local Docker image, but it fails in the Gitlab CI.
This is my gitlab-ci.yml:
image: node:16.15.0-alpine
stages:
- build
- lint
- test
install:
stage: build
script:
- cd frontend/
- npm ci
artifacts:
paths:
- frontend/
only:
- merge_requests
format-and-lint:
stage: lint
needs: [install]
script:
- cd frontend/
- npm run format
- npm run lint
artifacts:
paths:
- frontend/
only:
- merge_requests
# --------------- This step always fails ---------------
cypress:
stage: test
needs: [format-and-lint]
script:
- cd frontend/
- npm run build
- npm run preview
- npx cypress run --spec "cypress/integration/lehrenden-eintragung/*"
artifacts:
paths:
- frontend/
only:
- merge_requests
# -----------------------------------------------------
vitest:
stage: test
needs: [format-and-lint]
script:
- cd frontend/
- npm run test
artifacts:
paths:
- frontend/
only:
- merge_requests
My package.json looks like this:
{
"bezeichnungLang": "llp-frontend",
"version": "1.0.0",
"type": "module",
"scripts": {
"dev": "svelte-kit dev",
"build": "svelte-kit build",
"package": "svelte-kit package",
"preview": "svelte-kit preview",
"prepare": "svelte-kit sync",
"check": "svelte-check --tsconfig ./tsconfig.json --compiler-warnings \"css-unused-selector:ignore\"",
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --ignore-path .gitignore --check --plugin-search-dir=. . && eslint --ignore-path .gitignore .",
"format": "prettier --ignore-path .gitignore --write --plugin-search-dir=. .",
"test": "vitest run",
"coverage": "vitest run --coverage"
},
"devDependencies": {
"#sveltejs/adapter-auto": "^1.0.0-next.40",
"#sveltejs/kit": "^1.0.0-next.323",
"#testing-library/jest-dom": "^5.16",
"#testing-library/svelte": "^3.1",
"#testing-library/user-event": "^14.0",
"#tsconfig/svelte": "^3.0",
"#types/bootstrap": "^5.1.9",
"#types/jest": "^27.4",
"#types/testing-library__jest-dom": "^5.14",
"#typescript-eslint/eslint-plugin": "^5.18",
"#typescript-eslint/parser": "^5.18",
"bootstrap": "^5.1",
"cypress": "^9.6.1",
"eslint": "^8.14",
"eslint-config-prettier": "^8.5",
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-svelte3": "^3.4",
"jsdom": "^19.0",
"popper.js": "^1.16",
"prettier": "^2.6",
"prettier-plugin-svelte": "^2.7",
"purgecss-from-svelte": "^2.0",
"simple-svelte-autocomplete": "^2.4.0",
"source-map-support": "^0.5",
"svelte": "^3.46",
"svelte-check": "^2.4",
"svelte-preprocess": "^4.10",
"ts-node": "^10.7",
"ts-replace-all": "^1.0",
"tslib": "^2.3",
"typescript": "^4.6.4",
"vitest": "^0.10",
"vitest-svelte-kit": "^0.0"
},
"babel": {
"plugins": [
"#babel/plugin-proposal-class-properties"
],
"presets": [
[
"#babel/preset-env"
]
]
},
"browserslist": [
"since 2017-06"
],
"dependencies": {
"sass": "^1.52.2",
"vite": "^2.9.9"
}
}
The GitlabCI fails with the following error:
Using docker image sha256:e5065cc780745864eeee3280fe347b33e90961c98c7d3e14d5b660e16aef24ce for node:16.15.0-alpine with digest node#sha256:1a9a71ea86aad332aa7740316d4111ee1bd4e890df47d3b5eff3e5bded3b3d10 ...
$ cd frontend/
$ ls
convertTestData.js
cypress
cypress.json
node_modules
package-lock.json
package.json
setupTestEnvironment.ts
src
static
svelte.config.js
tsconfig.json
vite.config.ts
vitest.config.js
$ npm run build
> build
> svelte-kit build
8:59:30 PM [vite-plugin-svelte] hmr is enabled but compilerOptions.dev is false, forcing it to true
8:59:30 PM [vite-plugin-svelte] options.hot is enabled but does not work on production build, forcing it to false
8:59:30 PM [vite-plugin-svelte] you are building for production but compilerOptions.dev is true, forcing it to false
vite v2.9.12 building for production...
transforming...
✓ 1 modules transformed.
[vite-plugin-svelte] /builds/llp/llp/frontend/src/routes/__layout.svelte:32:1 The keyword 'let' is reserved
file: /builds/llp/llp/frontend/src/routes/__layout.svelte:32:1
30 |
31 | function create_fragment(ctx) {
32 | let div3;
^
33 | let div2;
34 | let div0;
> /builds/llp/llp/frontend/src/routes/__layout.svelte:32:1 The keyword 'let' is reserved
at error (file:///builds/llp/llp/frontend/node_modules/svelte/compiler.mjs:17716:19)
at Parser$1.error (file:///builds/llp/llp/frontend/node_modules/svelte/compiler.mjs:17792:9)
at Parser$1.acorn_error (file:///builds/llp/llp/frontend/node_modules/svelte/compiler.mjs:17786:14)
at read_expression (file:///builds/llp/llp/frontend/node_modules/svelte/compiler.mjs:8652:16)
at mustache (file:///builds/llp/llp/frontend/node_modules/svelte/compiler.mjs:17475:28)
at new Parser$1 (file:///builds/llp/llp/frontend/node_modules/svelte/compiler.mjs:17751:21)
at parse$3 (file:///builds/llp/llp/frontend/node_modules/svelte/compiler.mjs:17883:20)
at compile (file:///builds/llp/llp/frontend/node_modules/svelte/compiler.mjs:32265:17)
at compileSvelte2 (file:///builds/llp/llp/frontend/node_modules/#sveltejs/vite-plugin-svelte/dist/index.js:351:20)
at async Object.transform (file:///builds/llp/llp/frontend/node_modules/#sveltejs/vite-plugin-svelte/dist/index.js:1791:25)
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1
All other steps in the pipeline run fine and finish without error. Please help!
This error is mainly from [vite-plugin-svelte] which couldn't transform line 32 at __layout.svelte component.
function create_fragment(ctx) {
let div3;
^
let div2;
let div0;
/builds/llp/llp/frontend/src/routes/__layout.svelte:32:1 The keyword 'let' is reserved
Try upgrade the following dependencies:
#sveltejs/kit (this has vite built-in, and doesn't need extra dependency)
svelte and related dependencies.
The solution was to specify an exact version of sveltejs/kit. The build fails on version 1.0.0-next.350 but runs fine with 1.0.0-next.323. Somehow, besides having the same node version, in the pipeline version 1.0.0-next.350 was installed.

npm install error in Bitbucket CI/CD pipeline

I have a pipeline set up for my Bitbucket repository that runs npm install if there is no node cache. Up until now it has worked fine, but the node cache was recently cleared, and now I'm getting the following output from Bitbucket (Pastebin link, due to character limit): https://pastebin.com/fY9TznNn
package.json:
{
"name": "my-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"#testing-library/jest-dom": "^4.2.4",
"#testing-library/react": "^9.3.2",
"#testing-library/user-event": "^7.1.2",
"#types/geojson": "^7946.0.7",
"#types/google-libphonenumber": "^7.4.19",
"#types/google-map-react": "^2.1.0",
"#types/jest": "^24.0.0",
"#types/node": "^12.12.55",
"#types/react": "^16.9.49",
"#types/react-bootstrap": "^0.32.22",
"#types/react-dom": "^16.9.8",
"#types/react-modal": "^3.10.6",
"#types/react-router-dom": "^5.1.5",
"#types/supercluster": "^5.0.2",
"axios": "^0.21.1",
"bootstrap": "^4.5.2",
"enzyme": "^3.11.0",
"eslint": "^6.8.0",
"firebase": "^7.24.0",
"geojson": "^0.5.0",
"google-libphonenumber": "^3.2.14",
"google-map-react": "^2.1.3",
"node-sass": "^4.0.0",
"react": "^16.13.1",
"react-async": "^10.0.1",
"react-bootstrap": "^1.3.0",
"react-cool-img": "^1.2.4",
"react-dom": "^16.13.1",
"react-dropzone": "^11.3.2",
"react-modal": "^3.12.1",
"react-router-dom": "^5.2.0",
"react-scripts": "^3.4.4",
"supercluster": "^7.1.0",
"typescript": "^3.2.1",
"use-supercluster": "^0.2.9"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"lint": "npx prettier --write src && npx eslint src --fix --ext .ts --ext .tsx"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"#types/enzyme": "^3.10.8",
"#types/enzyme-adapter-react-16": "^1.0.6",
"#typescript-eslint/eslint-plugin": "^3.10.1",
"#typescript-eslint/parser": "^3.10.1",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.6",
"eslint": "^7.23.0",
"eslint-config-airbnb": "^18.2.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jsx-a11y": "^6.3.1",
"eslint-plugin-promise": "^4.3.1",
"eslint-plugin-react": "^7.20.6",
"eslint-plugin-react-hooks": "^4.1.0",
"eslint-plugin-sort-keys-fix": "^1.1.1",
"prettier": "^2.1.1"
}
}
bitbucket-pipelines.yml:
image: node
definitions:
steps:
- step: &lint
name: Check code style
script:
- npm install # this is where the error occurs
- npx eslint **/*.ts[x]
caches:
- node
- step: &build
name: Build and test
script:
- echo > ".env"
- echo REACT_APP_GOOGLE_API_KEY=$GOOGLE_API_KEY >> ".env"
- echo REACT_APP_HANDSHAKE_API_KEY=$HANDSHAKE_API_KEY >> ".env"
- npm install
- npm run test
- npm run build
artifacts:
- build/**
caches:
- node
- step: &deploy
name: Deploy to Firebase
script:
- cd functions
- npm install
- cd ..
- pipe: atlassian/firebase-deploy:1.0.0
variables:
FIREBASE_TOKEN: $FIREBASE_TOKEN
PROJECT_ID: $FIREBASE_PROJECT
pipelines:
pull-requests:
"**":
- step: *lint
- step: *build
branches:
master:
- step: *lint
- step: *build
- step: *deploy
I'm concerned it might have something to do with the node-sass package as I've experienced issues with it before, and it's the first dependency to appear in the error. But I'm really not sure how to interpret this output or how to fix it. Thanks for any help!
Looks like my intuition was right—it was because of the node-sass package. Apparently it's deprecated. Installing sass instead fixed the problem!

Nuxt.js Webpack Build Error On Heroku

I have a Nuxt.js project to which I added just a few components for now. It runs flawlessly if build local. I wanted to test it on Heroku, however I get some webpack related build errors, in which I bury already 3 days.
remote: ERROR in ./~/babel-loader/lib?{"plugins":["transform-async-to-generator","transform-runtime"],"presets":[["es2015",{"modules":false}],"stage-2"],"cacheDirectory":false}!./~/vue-loader/lib/selector.js?type=script&index=0!./layouts/default.vue
remote: Module not found: Error: Can't resolve '../components/Sidebar/_Sidebar.vue' in '/tmp/build_fe4d2e874dff634cf8c7db3886460988/layouts'
remote: # ./~/babel-loader/lib?{"plugins":["transform-async-to-generator","transform-runtime"],"presets":[["es2015",{"modules":false}],"stage-2"],"cacheDirectory":false}!./~/vue-loader/lib/selector.js?type=script&index=0!./layouts/default.vue 30:0-57
remote: # ./layouts/default.vue
remote: # ./~/babel-loader/lib?{"plugins":["transform-async-to-generator","transform-runtime"],"presets":[["es2015",{"modules":false}],"stage-2"],"cacheDirectory":false}!./~/vue-loader/lib/selector.js?type=script&index=0!./.nuxt/App.vue
remote: # ./.nuxt/App.vue
remote: # ./.nuxt/index.js
remote: # ./.nuxt/server.js
I've also installed a fresh copy the nuxtjs.org starter theme but there is no error. It builds like charm.
This is my package.json
{
"name": "some-nuxt",
"version": "0.3.0",
"description": "nuxt-sandbox ",
"private": true,
"dependencies": {
"axios": "^0.15.3",
"nuxt": "^0.9.9",
"vue-touch": "^2.0.0-beta.4"
},
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
"precommit": "npm run lint",
"heroku-postbuild": "npm run build"
},
"devDependencies": {
"ava": "^0.18.2",
"babel-eslint": "^7.1.1",
"eslint": "^3.16.0",
"eslint-config-standard": "^6.2.1",
"eslint-loader": "^1.6.1",
"eslint-plugin-html": "^2.0.1",
"eslint-plugin-promise": "^3.4.2",
"eslint-plugin-standard": "^2.0.1",
"jsdom": "^9.11.0",
"node-sass": "^4.5.0",
"sass-lint": "^1.10.2",
"sass-loader": "^6.0.2"
}
}
This is some customisations from my nuxt.config.js file.
css: [
// '~assets/css/main.css',
{ src: '~assets/scss/app.scss', lang: 'sass' } // scss instead of sass
],
...
alias: {
'hammerjs$': 'vue-touch/dist/hammer-ssr.js'
},
build: {
/*
** Run ESLINT on save
*/
vendor: ['axios', 'vue-touch'],
extend (config, { isClient }) {
if (isClient) {
config.module.rules.push({
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude: /(node_modules)/
})
}
}
},
plugins: ['~plugins/vue-touch']
}
I found the reason that the case sensitive file system Linux of server of Heroku and insensitive system of mine are collided. When I renamed my sub components to uppercase, Github did not push the change to repo.
Neither npm run dev, nor npm run build has given any error in my computer. However when the Linux is looking for the exact names of the folder the problem occured.
This might be a precaution, working on a clean case sensitive formatted partition: https://coderwall.com/p/mgi8ja/case-sensitive-git-in-mac-os-x-like-a-pro
The title of the document explains the best. http://timnew.me/blog/2013/04/18/mac-os-x-case-insensitive-file-system-pitfall/
Adding up to what Gokhan Ozdemir's answer. I've faced a similar issue and realized I had changed a folder's name in a case-sensitive only way.
Example: from fonts to Fonts
It seems that it has to do with mac OS being a case insensitive environment.
I was able to solve it by following these steps:
git mv fonts fonts2
git mv fonts2 Fonts
git commit -m "changed case of dir"
Notice that I had to change to fonts2 initially so that the case-sensitive renaming takes place effectively.
Here's the SO answer explaining the solution to this problem.

Resources