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

Specified target is invalid. Provided: "standalone" should be one of server, serverless, experimental-serverless-trace #51

Closed
sennett opened this issue Nov 13, 2022 · 6 comments
Labels
documentation Changes only affect the documentation

Comments

@sennett
Copy link

sennett commented Nov 13, 2022

Thanks for this project. I'm having trouble running next build with target: 'standalone'. next.config.js is:

module.exports = {
  async redirects() {
    return [
      {
        source: '/town/:slug',
        destination: '/towns/:slug',
        permanent: true,
      },
    ]
  },
  output: 'standalone',
  target: 'standalone',
  compress: false,
}

When I run next built I get the following output:

Error: Specified target is invalid. Provided: "standalone" should be one of server, serverless, experimental-serverless-trace

Running npx --package @sladg/nextjs-lambda next-utils pack without this results in Process failed with error: Error: Folder: /Users/<project root>/.next/standalone does not exist!

From the next docs it seems we can have output: 'standalone',? But this doesn't seem to work either, or where am I going wrong? Thanks.

@sladg
Copy link
Owner

sladg commented Nov 14, 2022

Hey! just remove target it's not used, we just need to have output configured.

@sladg sladg added question Further information is requested and removed question Further information is requested labels Nov 14, 2022
@sladg
Copy link
Owner

sladg commented Nov 14, 2022

I will fix documentation in a minute, sorry for confusion.

@sladg sladg added the documentation Changes only affect the documentation label Nov 14, 2022
@sladg
Copy link
Owner

sladg commented Nov 14, 2022

Fixed in v3.20.4

@sladg sladg closed this as completed Nov 14, 2022
@sennett
Copy link
Author

sennett commented Nov 14, 2022

Thanks! In addition, for me Next 12 didn't output a .next/standalone directory, and so the next step npx --package @sladg/nextjs-lambda next-utils pack failed. I have just updated to Next 13 and it is outputting the .next/standalone as expected. The docs mention Next 12 - I made a PR here specifying Next 13: #53.

@sladg
Copy link
Owner

sladg commented Nov 14, 2022

Next13 works fine for you however 12 did not output the directory? 🤔 that's sus

@sennett
Copy link
Author

sennett commented Nov 14, 2022

It was Next 12.1 - maybe there was something messed up in my yarn.lock.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Changes only affect the documentation
Projects
None yet
Development

No branches or pull requests

2 participants