Skip to content

fix(nextjs): Fix requestAsyncStorageShim path resolution on windows#8875

Merged
lforst merged 1 commit intodevelopfrom
lforst-windows-request-async-storage-shim
Aug 28, 2023
Merged

fix(nextjs): Fix requestAsyncStorageShim path resolution on windows#8875
lforst merged 1 commit intodevelopfrom
lforst-windows-request-async-storage-shim

Conversation

@lforst
Copy link
Copy Markdown
Contributor

@lforst lforst commented Aug 28, 2023

Fixes build error reported in #8133 (comment)

@github-actions
Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 75.22 KB (+0.05% 🔺)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 31.2 KB (+0.11% 🔺)
@sentry/browser - Webpack (gzipped) 21.85 KB (0%)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (gzipped) 69.75 KB (+0.05% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (gzipped) 28.21 KB (+0.12% 🔺)
@sentry/browser - ES6 CDN Bundle (gzipped) 20.18 KB (0%)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (minified & uncompressed) 220.06 KB (+0.05% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (minified & uncompressed) 84.89 KB (+0.13% 🔺)
@sentry/browser - ES6 CDN Bundle (minified & uncompressed) 59.86 KB (0%)
@sentry/browser (incl. Tracing) - ES5 CDN Bundle (gzipped) 31.11 KB (+0.21% 🔺)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 75.24 KB (+0.05% 🔺)
@sentry/react - Webpack (gzipped) 21.88 KB (0%)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 93.04 KB (+0.02% 🔺)
@sentry/nextjs Client - Webpack (gzipped) 50.73 KB (+0.07% 🔺)

const middlewareWrapperTemplatePath = path.resolve(__dirname, '..', 'templates', 'middlewareWrapperTemplate.js');
const middlewareWrapperTemplateCode = fs.readFileSync(middlewareWrapperTemplatePath, { encoding: 'utf8' });

const requestAsyncStorageShimPath = path.resolve(__dirname, '..', 'templates', 'requestAsyncStorageShim.js');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seeing that we have a few of these below, should we all replace them with an @sentry/nextjs/* path?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this particular thing we're changing in this PR is actually something we let webpack import for us. All of the other paths in this file are actual templates we just call fs.readFile on, so no need to have some sort of special resolution as of now.

"module": "build/esm/index.server.js",
"browser": "build/esm/index.client.js",
"types": "build/types/index.types.d.ts",
"exports": {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious if this will cause any problems but given that tests pass, let's see 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can never know... 😶‍🌫️

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lforst lforst merged commit 478b5e2 into develop Aug 28, 2023
@lforst lforst deleted the lforst-windows-request-async-storage-shim branch August 28, 2023 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants