Skip to content

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

Closed
@lukasholzer

Description

@lukasholzer

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions