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

Regression: Error [@astrojs/node] Setting the 'mode' option is required. #5422

Closed
1 task done
mhdcodes opened this issue Nov 16, 2022 · 3 comments
Closed
1 task done
Assignees

Comments

@mhdcodes
Copy link
Contributor

What version of astro are you using?

v1.6.9

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

Node

What package manager are you using?

npm

What operating system are you using?

Linux

Describe the Bug

@astrojs/node/dist/index.js:12:11
@astro-app:build:   Code:
@astro-app:build:       11 |   if (!(userOptions == null ? void 0 : userOptions.mode)) {
@astro-app:build:     > 12 |     throw new Error(`[@astrojs/node] Setting the 'mode' option is required.`);
@astro-app:build:          |           ^
@astro-app:build:       13 |   }
@astro-app:build:       14 |   let needsBuildConfig = false;
@astro-app:build:       15 |   let _options;

Link to Minimal Reproducible Example

https://github.com/codiume/orbit/actions/runs/3483931326/jobs/5827944357

Participation

  • I am willing to submit a pull request for this issue.
@mhdcodes mhdcodes changed the title Regression: Error: [@astrojs/node] Setting the 'mode' option is required. Regression: Error [@astrojs/node] Setting the 'mode' option is required. Nov 16, 2022
@matthewp matthewp self-assigned this Nov 17, 2022
@matthewp
Copy link
Contributor

matthewp commented Nov 17, 2022

Hi @the-dijkstra, this became a required field in @astrojs/node version 2.0.0, a major version changed, so this is not a regression. See this release PR: #5046

Note that if you want the old behavior just set the mode to middleware: nodejs({ mode: 'middleware' })

@mhdcodes
Copy link
Contributor Author

I opened the issue because I noticed it on v1.6.9 so I thought it's weird to introduce a breaking change in a patch version.

@matthewp
Copy link
Contributor

That's the version of Astro. Astro did not have a breaking change, the Node adapter did, it's a separate package.

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

No branches or pull requests

2 participants