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

Update Next example #619

Closed
wants to merge 3 commits into from
Closed

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?

@fwang
Copy link
Contributor

fwang commented Oct 16, 2024

we are moving sst/ion -> sst/sst and unfortunately this is going to be a messy process because of github's limitations

i'm going to close this PR for now and it can be re-opened in the new sst/sst repo that will be ready in the next few days if still relevant

@fwang fwang closed this Oct 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants