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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,555,547
Community Members
 
Community Events
184
Community Groups

How do I fix build error with '@sentry/react'

Edited

Whenever I try to implement Pipelines, I got this error message during npm build time.

 

`Module not found: Error: Can't resolve '@sentry/react' in '/opt/atlassian/pipelines/agent/build/src'`

 

To fix this error, I put below command in bitbucket-pipelines.yml file but still build module not found error is happened.

 

```

- step:
  name: 'installing dependencies...'
  caches:
    - node
  script:
      - rm -r node_modules
      - npm install -g npm
      - npm install
- step:
  name: 'Building project'
  caches:
    - node
  script:
      - CI=false npm run build
      artifacts:
      - build/**

```

 

How can I fix this module issue during pipeline work?

Build is working well in local environment and also Jenkins environment.

1 answer

1 accepted

1 vote
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Oct 05, 2022

Hi @Alice Kim and welcome to the community!

Which command is giving you this error? I assume it is the command CI=false npm run build ?

I see that you are installing dependencies in the previous step named 'installing dependencies...'. Are these dependencies needed in order to run the build in the next step, 'Building project'? If so, I would suggest building the project in the same step where you install the dependencies, and then checking if that eliminates the error.

For every step in your bitbucket-pipelines.yml file, a Docker container starts, your repo is cloned (unless you have disabled clone), then the commands of that step's script are executed, and afterwards the container gets destroyed. If you need any dependencies to run a build, they should be installed in the same step that uses them.

I see that you are using node cache, but please keep in mind that (1) caches are saved after the first successful build, and (2) caches are cleared automatically after 1 week and repopulated during the next successful build. Therefore, builds should be configured to work whether or not the cache is present.

Kind regards,
Theodora

I don't know why it is working now but it works.

Thank you for your kindful answer. 🥲

Later if it is not working then I'll try your suggestion!

Suggest an answer

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

Atlassian Community Events