Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.

TypeError: Invalid URL #250

Open
salaryhero-anh opened this issue Nov 30, 2023 · 4 comments
Open

TypeError: Invalid URL #250

salaryhero-anh opened this issue Nov 30, 2023 · 4 comments

Comments

@salaryhero-anh
Copy link

salaryhero-anh commented Nov 30, 2023

Express application running with babel-node got error: TypeError: Invalid URL

Command: npx appmap-agent-js -- nodemon -r dotenv/config --exec babel-node src/app.js

[nodemon] starting babel-node -r dotenv/config src/app.js(node:71043) ExperimentalWarning: Custom ESM Loaders is an experimental feature and might change at any time (Usenode --trace-warnings ...` to show where the warning was created)

(node:71074) ExperimentalWarning: Custom ESM Loaders is an experimental feature and might change at any time
(Use node --trace-warnings ... to show where the warning was created)

[[email protected]] Detected an unknown error. If this error disappears when not recording your application, it is probably an issue within the appmap framework. If this is the case, please consider submitting a bug report at:
https://github.com/getappmap/appmap-agent-js/issues

node:internal/errors:496
ErrorCaptureStackTrace(err);
^

TypeError: Invalid URL
at new NodeError (node:internal/errors:405:5)
at new URL (node:internal/url:611:13)
at toAbsoluteUrl (file:///Users/Desktop/hris-worker/node_modules/@appland/appmap-agent-js/dist/bundles/recorder-node.mjs:37:3)
at parseSourcemap (file:///Users/Desktop/hris-worker/node_modules/@appland/appmap-agent-js/dist/bundles/recorder-node.mjs:631:29)
at extractMissingUrlArray (file:///Users/Desktop/hris-worker/node_modules/@appland/appmap-agent-js/dist/bundles/recorder-node.mjs:1706:31)
at instrumentInject (file:///Users/Desktop/hris-worker/node_modules/@appland/appmap-agent-js/dist/bundles/recorder-node.mjs:2723:18)
at instrument (file:///Users/Desktop/hris-worker/node_modules/@appland/appmap-agent-js/dist/bundles/recorder-node.mjs:3164:56)
at Module._compile (file:///Users/Desktop/hris-worker/node_modules/@appland/appmap-agent-js/dist/bundles/recorder-node.mjs:3917:9)
at Module._compile (/Users/Desktop/hris-worker/node_modules/pirates/lib/index.js:136:24)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10) {
input: '/Users/Desktop/hris-worker/src/',
code: 'ERR_INVALID_URL'
}

Node.js v18.17.1
[nodemon] app crashed - waiting for file changes before starting...`

@brikelly
Copy link
Contributor

Hi @salaryhero-anh , thank you for logging this issue. We are in the final stages of development of our new NodeJS agent, which is hosted in this repo: https://github.com/getappmap/appmap-node

If possible, could you check if your issue exists with this new agent instead? We would also just love your feedback on it. It already supports Express.js and Node 18. You can try it with npx appmap-node@latest <command>.

Thank you!

@salaryhero-anh
Copy link
Author

Cool @brikelly will check this out

@salaryhero-anh
Copy link
Author

Hi @brikelly, dose this support project using babel?

@brikelly
Copy link
Contributor

Hi @salaryhero-anh - Babel should be fine, assuming it's just used for transpiling code. The new Node agent maps JavaScript code regardless of how it came to be :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants