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

[Bug]: ntl dev with ssl certificates does not work with the next plugin #1877

Closed
2 tasks done
lukasholzer opened this issue Jan 11, 2023 · 2 comments
Closed
2 tasks done
Assignees
Labels
priority: high type: bug code to address defects in shipped code

Comments

@lukasholzer
Copy link
Contributor

Summary

The new version of the next plugin does not work with https configuration anymore. Old version @netlify/plugin-nextjs@4.8.0 still works.

developing with ssl is sometimes needed when working with headless CMS for example https://www.storyblok.com/ (as you run the site inside their iframe which requires https)

CleanShot 2023-01-11 at 10 29 19

Crashing with this error:

Error: There was an internal error while processing your request
    at https://639708f6d7f813000870695c--edge.netlify.app/bootstrap/function_chain.ts:130:15
    at async backoffRetry (https://639708f6d7f813000870695c--edge.netlify.app/bootstrap/retry.ts:24:14)
    at async FunctionChain.fetchOrigin (https://639708f6d7f813000870695c--edge.netlify.app/bootstrap/function_chain.ts:111:17)
    at async FunctionChain.run (https://639708f6d7f813000870695c--edge.netlify.app/bootstrap/function_chain.ts:288:22)
    at async handleRequest (https://639708f6d7f813000870695c--edge.netlify.app/bootstrap/handler.ts:59:22)
    at async Server.#respond (https://deno.land/std@0.136.0/http/server.ts:298:18)

Steps to reproduce

  1. Create a next.js site
  2. generate with mkcert a new pair of local certificates
  3. Adapt the netlify.toml with:
    [dev.https]
    certFile = "localhost.pem"
    keyFile = "localhost-key.pem"
  4. Run ntl dev

A link to a reproduction repository

https://github.com/lukasholzer/netlify-next-redirect-issue/tree/https-issue

Next Runtime version

4.29.4

More information about your build

  • I am building using the CLI
  • I am building using file-based configuration (netlify.toml)

What OS are you using?

Mac OS

Your netlify.toml file

`netlify.toml`
# Paste content of your `netlify.toml` file here

Your public/_redirects file

`_redirects`
[dev.https]
certFile = "localhost.pem"
keyFile = "localhost-key.pem"

Your next.config.js file

`next.config.js`
/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
}

module.exports = nextConfig

Builds logs (or link to your logs)

Build logs
# Paste logs here

Function logs

Function logs
# Paste logs here

.next JSON files

generated .next JSON files
# Paste file contents here. Please check there isn't any private info in them
# You can either build locally, or download the deploy from Netlify by clicking the arrow next to the deploy time.
@lukasholzer lukasholzer added the type: bug code to address defects in shipped code label Jan 11, 2023
@sarahetter sarahetter self-assigned this Jan 20, 2023
@sarahetter
Copy link

sarahetter commented Jan 23, 2023

Investigation notes:
Most recent functioning version: 4.17.1-runtime.0.

This behaviour was introduced with our adding the support for edge middleware in dev.
#1546
(and fixes: f69d9db & 0667662)

@sarahetter
Copy link

This is fixed by updating the cli 😆
netlify-cli/12.9.2 works when running ntl dev on a next site with ssl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: high type: bug code to address defects in shipped code
Projects
None yet
Development

No branches or pull requests

2 participants