Questions tagged [netlify]

Ask questions about the Netlify setup, config or just in general using the netlify-cli or online at app.netlify.com

enter image description here

Netlify is a unified platform that automates your code to create high-performant, easily maintainable static web sites.
Simply push your code and let us take care of the rest.

2231 questions
17
votes
6 answers

Set environment variable for build in Netlify

I'm trying to set an environment variable for an API key that I don't want in my code. My source javascript looks something like this : .get(`http://api-url-and-parameters&api-key=${process.env.API_KEY}`) I'm using webpack and the package…
Maëlig
  • 409
  • 1
  • 4
  • 10
16
votes
1 answer

netlify deploy failed: git ref refs/heads/master does not exist or you do not have permission

I ran into a bigger problem and am really desperate and downturned because I cannot figure out a solution. I am using a Notebook with Linux Debian 9, git for version control, bitbucket as source code repository service and netlify as production…
timunix
  • 609
  • 6
  • 19
15
votes
2 answers

How to deploy express.js server to Netlify

I am attempting to deploy a Vue.js, Node, Express, MongoDB (MEVN) stack application to Netlify. I successfully deployed the front end of the application to Netlify, and am now attempting to deploy the express server, based on the following…
JS_is_awesome18
  • 1,587
  • 7
  • 23
  • 67
14
votes
0 answers

Sentry: Enable readable stack traces when using React

I am using Sentry to catch any error on production with Netlify's plugin to upload the source maps. I got the message: Error matching your configuration.Configure Stack Trace Linking to fix this problem. What I should fill on "Stack Trace Root"…
Rodrigo
  • 135
  • 4
  • 45
  • 107
13
votes
2 answers

GraphQL Error Field "image" of type "File" must have a selection of subfields. Did you mean "image { ... }"?

I am building a site with gatsby and Netlify CMS. I used the Gatsby Site Starter. I keep getting a "GraphQL Error Field "image" of type "File" must have a selection of subfields. Did you mean "image { ... }"?" error when trying to deploy to…
G. Ball.
  • 169
  • 2
  • 9
13
votes
1 answer

Netlify Headers Cache Control For Static Assets

Is it possible to have Cache Control but only for static assets like image, font, css and js? Here's my workaround [[headers]] for = "/*" # This defines which paths this specific [[headers]] block will cover. [headers.values] Cache-Control =…
Yudy Ananda
  • 520
  • 2
  • 8
  • 28
13
votes
1 answer

How to host multiple Github repos using the same custom domain on Netlify?

I am currently hosting my personal website (created using blogdown and Hugo) using Netlify at wjakethompson.com. This is deployed through a Github repository. I now have a bookdown project in a separate repository that I would also like to host on…
Jake Thompson
  • 2,591
  • 1
  • 16
  • 32
12
votes
1 answer

Next.js component slow on Netlify, fast on Vercel

I have a relatively simple Next.js app and am using Next.js' component to render two small images, as such:
Guillermo Brachetta
  • 3,857
  • 3
  • 18
  • 36
12
votes
3 answers

How to set up CORS in Netlify Serverless function

I couldn't find any way how can I set up CORS using serverless netlify functions. I have used this function example to create my own e-mail form sender: const nodemailer = require('nodemailer'); exports.handler = function(event, context, callback)…
user4572896
  • 131
  • 2
  • 7
12
votes
2 answers

Netlify: How do you deploy sites that are nested in a folder?

I have a repo that has the backend and frontend (create-react-app) in two separate folders. For the build command, I have something like cd frontend && npm run build and for the publish directory, I have something like frontend/build, but this is…
sdfsdf
  • 5,052
  • 9
  • 42
  • 75
11
votes
2 answers

Netlify says, "error Gatsby requires Node.js 14.15.0 or higher (you have v12.18.0)"—yet I have the newest Node version?

After migrating from Remark to MDX, my builds on Netlify are failing. I get this error when trying to build: 10:13:28 AM: $ npm run build 10:13:29 AM: > blog-gatsby@0.1.0 build /opt/build/repo 10:13:29 AM: > gatsby build 10:13:30 AM: error Gatsby…
Magnus Kolstad
  • 407
  • 1
  • 6
  • 17
11
votes
4 answers

Netlify does not recognize the URL params when using react-router-dom

I am creating a react app that uses react router. I am using the router to match the paths like :/bankName-:credit and it works fine in local development. The only require path for my application is :/bankName-:credit and every other path will hit…
aditya81070
  • 678
  • 1
  • 5
  • 22
11
votes
2 answers

How to provide internationalization properly using Gatsby + Netlify CMS

I'm trying to make a multi-language site and faced some problems. Expected behavior: Language automatically changes depends on browser language The user can switch language example: https://tic-tac-toe-ai.surge.sh/ I saw gatsby-plugin-i18nand…
Ponchique
  • 201
  • 3
  • 11
11
votes
2 answers

Can Netlify redirect traffic from http to https without forcing SSL

Another question asked quite often by the Netlify community. "Can Netlify redirect traffic from http to https without forcing SSL (TLS)?" Once you have a certificate in place, you can check a box to force TLS. This will both set a redirect from…
talves
  • 13,993
  • 5
  • 40
  • 63
10
votes
2 answers

Vite.js React Build Not Redirecting On Netlify And Vercel

I made a react build with vite.js. When building for production and testing on local host all is working fine. But when i deploy to Netlify or vercel routes that i created with react-router are not accessible via entering their url directly, but…
Shantiscrip
  • 363
  • 3
  • 8