Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Pipeline failure in monorepo (NPM Workspaces) when importing local package during build (Vite)

bouharri
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 20, 2024

Did as much troubleshooting as reasonable (e.g., mocking pipeline locally in Docker, listing installed packages in pipeline, various config file placements, etc) but I could not get past this issue:

[vite]: Rollup failed to resolve import "core/style.css" from "/opt/atlassian/pipelines/agent/build/packages/ui/src/index.ts"

My monorepo was symlinking core from the packages/ directory that ui is in, and is the only issue that I can think of because isolating the ui package from the NPM workspaces setup made the build complete successfully in the pipeline. Any ideas?

Pipeline as follows:

image: node:22

pipelines:
tags:
"@org/ui-*":
- step:
name: Build
caches:
- node
script:
- cd packages/ui
- npm install
- npm run build // FAILS HERE
artifacts:
- packages/ui/dist/**
- step:
name: Publish
script:
- pipe: atlassian/npm-publish:1.1.0
variables:
NPM_TOKEN: $NPM_TOKEN
FOLDER: ./packages/ui

"@org/core-*":
- step:
name: Build
caches:
- node
script:
- cd packages/core
- npm install
- npm run build // DOESN'T FAIL (no local dependencies)
artifacts:
- packages/core/dist/**
- step:
name: Publish
script:
- pipe: atlassian/npm-publish:1.1.0
variables:
NPM_TOKEN: $NPM_TOKEN
FOLDER: ./packages/core

1 answer

0 votes
Nicolas Grossi
Banned
June 20, 2024

Did you tried removing node_ module before install ?

 

Nicolas

bouharri
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 27, 2024

Node_modules is gitignored in the repo, so it shouldn't be there when it gets pulled. I have deleted the Node cache, to no effect.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events