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

Update Next example #619

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open

Update Next example #619

wants to merge 3 commits into from

Conversation

VirtuaBoza
Copy link

Adds the webpack config override to get around an issue when a dependency depends on https://www.npmjs.com/package/process, causing the middleware compilation to load the browser shim.

@jayair
Copy link
Contributor

jayair commented Jul 4, 2024

This is specifically for middleware?

@jayair jayair self-assigned this Jul 4, 2024
@VirtuaBoza
Copy link
Author

This is specifically for middleware?

yes

@jayair
Copy link
Contributor

jayair commented Jul 13, 2024

I see. Can you give some ways I can test this? When does this happen?

@VirtuaBoza
Copy link
Author

I see. Can you give some ways I can test this? When does this happen?

Sorry it took so long to get around to this. Here's an example of the issue: https://github.com/VirtuaBoza/sst-process-repro/blob/main/src/middleware.ts#L5-L11

Attempting to access sst Resources in Next middleware will throw "X is not linked" because an NPM package called "process" is installed in node_modules and sst is importing from "process" without specifying "node:process" due to issues with other runtimes. Next's middleware/edge webpack config is picking up the browser implementation from that package.

The NPM package I'm referencing is: https://www.npmjs.com/package/process
That package is a dependency of some popular libraries such as Cypress.

@jayair
Copy link
Contributor

jayair commented Jul 26, 2024

Oh I see. Is there a downside to SST using node:process internally instead of process?

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