npm run dev serves your app over HTTPS so CDF can embed it in an iframe. Without a trusted certificate, the browser blocks the embed and shows Not Secure or “the webpage at https://localhost:3001/ might be having issues”. You need to establish trust between your browser and the local dev server before CDF can load your app.
You can establish trust in two ways:
- Install
mkcert: One-time setup that works everywhere. Requires admin access. - Accept the certificate in the browser: No installation needed, but you must repeat this on every dev server restart.
Installing mkcert (recommended)
Install the mkcert binary
- macOS / Linux
- Windows (Chocolatey)
- Windows (Scoop)
Run setup-https
mkcert Certificate Authority (CA) to your system trust store and issues a certificate for localhost, local.cognite.ai, and *.local.cognite.ai.
Restart the dev server and browser
npm run dev, restart it, then fully quit and reopen your browser so it re-reads the trust store. The address bar should show the lock icon.Accepting the certificate manually (no admin required)
If you don’t have admin access, manually trust the dev server’s self-signed certificate in your browser:Start the dev server
https://localhost:3001).Open the localhost URL in a new tab
- Chrome / Edge
- Firefox
- Safari
https://localhost:3001 might be having issues” message as the app only renders within the CDF iframe, not in a standalone window. You can close this tab.Reload CDF
Troubleshooting
`apps setup-https` says 'mkcert is not installed'
`apps setup-https` says 'mkcert is not installed'
- Running
npx @cognite/cli@latest apps setup-httpsfails withmkcert is not installed.
- The CLI cannot find
mkcerton yourPATH.
- Install
mkcert(see Installing mkcert (recommended)), then run the command again. - On Windows, run
choco install mkcertfrom an elevated PowerShell.
Browser still shows Not Secure after setup
Browser still shows Not Secure after setup
- The browser shows Not Secure even after
apps setup-httpscompleted successfully.
- The browser cached the old trust store state and hasn’t re-read it yet.
- Fully quit and reopen the browser.
- On Windows, close Edge from the system tray, not just the window.
`apps setup-https` not found
`apps setup-https` not found
- The CLI reports that the
apps setup-httpscommand doesn’t exist.
- Your local version of
@cognite/cliis older than1.4.0, which is when the command was added.
- Run the command with
@latestto bypass any pinned version:
- If
@lateststill resolves to a version older than1.4.0, delete any.npmrcin the current directory that pins a registry or version.
The port keeps incrementing (3001 → 3002 → 3003 …)
The port keeps incrementing (3001 → 3002 → 3003 …)
- Each
npm run devstart uses a higher port number.
- An orphaned
nodeprocess from a previous session is still holding the port.
- Find and stop the process. You can only stop processes you own.