Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileNotFound while resolving package "source-map" #3684

Open
thuynh opened this issue Oct 21, 2023 · 1 comment
Open

FileNotFound while resolving package "source-map" #3684

thuynh opened this issue Oct 21, 2023 · 1 comment
Labels
agent-nodejs Make available for APM Agents project planning. awaiting reply community

Comments

@thuynh
Copy link

thuynh commented Oct 21, 2023

Describe the bug

Getting the following error when running this inside of a docker container:

error: FileNotFound while resolving package "source-map" from "/root/.bun/install/cache/elastic-apm-node@4.1.0/lib/load-source-map.js

The runtime is bun https://bun.sh/

server.ts

import apm from 'elastic-apm-node';

apm.start({
  serviceName: 'service-name',
  secretToken: process.env.ELASTIC_APM_ENVIRONMENT!!,
  serverUrl: process.env.ELASTIC_APM_SERVER_URL!!,
  environment: process.env.ELASTIC_APM_ENVIRONMENT!!
});

package.json

{
  "name": "search-service",
  "version": "1.0.50",
  "scripts": {
    "dev": "bun run --watch server.ts"
  },
  "dependencies": {
    "@elysiajs/cors": "^0.7.1",
    "@sentry/bun": "^7.74.1",
    "elastic-apm-node": "^4.1.0",
    "elysia": "latest",
    "load-source-map": "^3.0.1"
  },
  "devDependencies": {
    "bun-types": "^1.0.6"
  },
  "module": "server.ts"
}

Environment (please complete the following information)

  • OS: Bun 1.0.6
@github-actions github-actions bot added agent-nodejs Make available for APM Agents project planning. community triage labels Oct 21, 2023
@david-luna
Copy link
Member

Hi,

the agent does not officially support Bun but this seems an installation issue since source-map is a dependency of the agent.

I've run your code successfully in my local env but I could reproduced the issue if I delete the node_modules folder. I guess you have a Dockerfile to create the container. Could you check if the dependencies are being installed? O could you paste here details of that file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-nodejs Make available for APM Agents project planning. awaiting reply community
Projects
None yet
Development

No branches or pull requests

2 participants