grafana / grafana/faro-javascript-bundler-plugins

[faro-cli] Sourcemap Upload fails if the path contains brackets

Open
#456 1 comment 0 reactions 1 assignee Claimed by @eskirk View on GitHub
Dominant language
TypeScript
Stars
10
Forks
10
Avg merge
2h 34m
Merged PRs (30d)
5

Description

It is very common for next.js apps to contain pathts with brackets because of the file based routing.

However, this breaks the sourcemap upload.

You can update your next.js example repository with a path that contains brackets and reproduce the issue.

Example path: `src/app/(self-service)/admin`

Example command:

npx faro-cli upload --endpoint "https://faro-api-prod-eu-west-0.grafana.net/faro/api/v1" --app-id='123' --stack-id='300000' --bundle-id "$FARO_BUNDLE_ID" --api-key "$FARO_SOURCEMAP_TOKEN" --output-path './.next/static/chunks' --recursive --verbose

The error happens with and without gzip.

It looks like a regression. I had a successful upload last week.

The error message:

```
Faro] Uploading page-781b979ffbfb791e.js.map to https://faro-api-prod-eu-west-0.grafana.net/faro/api/v1/app/976/sourcemaps/ZAqf4zP2ykozPXRIYMyP_
/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `curl -s -X POST "https://faro-api-prod-eu-west-0.grafana.net/faro/api/v1/app/976/sourcemaps/ZAqf4zP2ykozPXRIYMyP_" -H "Authorization: Bearer 302415:glc_eyXXXXXXXXXXXQ==" -H "Content-Type: application/json" --data-binary @/Users/sbaechler/.next/static/chunks/app/(self-service)/admin/endpoints/create/page-781b979ffbfb791e.js.map'
Error executing cURL command: Error: Command failed:
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.