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

Unable to build with sdk that includes axios #7330

Closed
1 task
braco opened this issue Jun 8, 2023 · 2 comments
Closed
1 task

Unable to build with sdk that includes axios #7330

braco opened this issue Jun 8, 2023 · 2 comments
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) feat: ssr Related to SSR (scope)

Comments

@braco
Copy link

braco commented Jun 8, 2023

What version of astro are you using?

2.6.1

Are you using an SSR adapter? If so, which one?

deno

What package manager are you using?

yarn

What operating system are you using?

mac

What browser are you using?

chrome

Describe the Bug

One of the routes includes an sdk that includes axios.

yarn build

is throwing this error:

[commonjs--resolver] Cannot bundle Node.js built-in "http" imported from "node_modules/.deno/axios@0.27.2/node_modules/axios/lib/adapters/http.js". Consider disabling ssr.noExternal or remove the built-in dependency.

I'm interpreting this to mean that axios is using the node version of itself and the require('http') is causing this error. But other than that I'm a little baffled, where is this error coming from? The main search result I can find is a bug on vite.

Participation

  • I am willing to submit a pull request for this issue.
@bluwy
Copy link
Member

bluwy commented Jun 11, 2023

Hmm it looks like we didn't set target: "webworker" here unlike other similar integration setup:

vite.ssr = {
noExternal: true,
};

It might also be fixed by #7288

@bluwy bluwy added the - P3: minor bug An edge case that only affects very specific usage (priority) label Jun 11, 2023
@Princesseuh Princesseuh added the feat: ssr Related to SSR (scope) label Jul 17, 2023
@natemoo-re
Copy link
Member

I'm going to close this since I assume that #7288 fixed it and there's no reproduction for me to confirm. If you're still running into trouble, please feel free to open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) feat: ssr Related to SSR (scope)
Projects
None yet
Development

No branches or pull requests

4 participants