Skip to content

Commit

Permalink
define main and module
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasBa committed Dec 2, 2024
1 parent 083594e commit de1a11f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,10 @@ jobs:
key: ${{ needs.job_build.outputs.dependency_cache_key }}
enableCrossOsArchive: true

- name: Increase yarn network timeout on Windows
if: contains(matrix.os, 'windows')
run: yarn config set network-timeout 600000 -g

- name: Install dependencies
env:
SKIP_PLAYWRIGHT_BROWSER_INSTALL: "1"
Expand All @@ -1421,10 +1425,6 @@ jobs:
run: |
git config --global --add safe.directory "*"
- name: Increase yarn network timeout on Windows
if: contains(matrix.os, 'windows')
run: yarn config set network-timeout 600000 -g

- name: Setup python
uses: actions/setup-python@v5
if: ${{ !contains(matrix.container, 'alpine') }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
// This tests asserts that @sentr/profiling-node is not patching globalThis values, which
// breaks our runtime detection and can break instrumentation
// https://github.com/getsentry/sentry-javascript/issues/14525#issuecomment-2511208064
import * as Sentry from '@sentry/node';
import { nodeProfilingIntegration } from '@sentry/profiling-node';

console.log('🧵 Starting ESM test');

const wait = ms => new Promise(resolve => setTimeout(resolve, ms));

function assertUnpatechedRequire() {
if (typeof globalThis.require !== 'undefined') {
if (typeof require !== 'undefined') {
// Test that globalThis.require is not defined by any side effects of the profiling
// https://github.com/getsentry/sentry-javascript/issues/13662
throw new Error(
`globalThis.require should not be defined, check that profiling integration is not defining it, received: ` +
typeof globalThis.require,
typeof require,
);
}
}

import * as Sentry from '@sentry/node';
import { nodeProfilingIntegration } from '@sentry/profiling-node';
const wait = ms => new Promise(resolve => setTimeout(resolve, ms));

Sentry.init({
dsn: 'https://7fa19397baaf433f919fbe02228d5470@o1137848.ingest.sentry.io/6625302',
Expand Down
1 change: 1 addition & 0 deletions packages/profiling-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"author": "Sentry",
"license": "MIT",
"main": "lib/cjs/index.js",
"module": "lib/esm/index.js",
"types": "lib/types/index.d.ts",
"exports": {
"./package.json": "./package.json",
Expand Down

0 comments on commit de1a11f

Please sign in to comment.