Netlify Dev parity with deployments

Netlify Dev is fantastic - it just works. I’ve used competitors similar products but this is very smooth.

But there are a few differences when using add on services that are dissapointing. I few I can recall are

  • Auth is fiddly - but at least it works once set up
  • Gating with roles doesn’t work
  • 404 routing
  • Function logging

Haha hey again :wave:t2:

Netlify Dev is awesome! :grin: Love that you’re experiencing that too. I’m a big fan as well.

Auth - Auth is interesting with dev because it doesn’t actually run a local auth server- it hits the same auth endpoint as your production / branch / preview sites. IIRC they all share a single GoTrue auth instance hosted by Netlify. So as far as dev goes, that should be transparent. Where things do get tricky is that you may have the same JWT or JWT carry-over from your prod site or other site tiers. My best recommendation with auth, especially in local dev, is to use Private tabs generously and always double-test with private tabs to make sure that a totally fresh session workflow will behave the way you want it to :+1:t2: since dev uses the same back-end auth instance, there definitely are cases where it can feel fiddly

Gating - So gating when running locally via Netlify Dev actually should work across the board. I wonder if this adds to the confusion in the other thread we have :thinking: because this is just part of the local redirect engine (all redirects should work locally) and you can read the source for it here - note that the JWT token and roles are accounted for. So, like I said, this should run locally just fine and accomplish the ‘gating’ without issue - but I’ll reference the above as well and stress the necessity for running in a private tab / fresh session to really make sure it’s working correctly the way you’d like it to. I did just verify this is working correctly on one of my demo auth projects running locally (just double check to make sure you’re hitting port :8888 because I spent a couple minutes hitting :8000 and scratching my head :rofl:)

404 Routing - Can you elaborate a bit on what you were seeing locally and what you expected to see instead? I’m guessing this may also be an issue with auth/gating so maybe the above will help

Function logging - When running Netlify Dev locally, all function logs should dump out directly to the STDOUT of the process that you kicked off Netlify Dev with. Generally that should be really seamless and if you have a function that runs console.log('foo') you should definitely see that in your process output :thinking: do you have a sample of where you may not be seeing that?

Hope that helps!


Jon

Why hello! :stuck_out_tongue:

You are quite correct and there has been so much happening I’m quite possibly getting mixed up.

I’ll recheck the 'should work’s.

I defintely found that role gated access always failed so when I do a dev build I leave out the _redirects file.

For auth I’ll use private tabs - that’s neat idea as they are effectively a clean context. Never thought of that.

The only issue I currenty defintely have with the auth widget is when the JWT expires it gets confused if you are logged in. logout and Ctrl+F5 sorts that. I guess I need to figure how to add checks for expiry and refresh if required (I see the API), Would be nice if the widget did that though.

Thanks once again.

Function logging - When running Netlify Dev locally, all function logs should dump out directly to the STDOUT of the process that you kicked off Netlify Dev with.

Ah! So in Netlify dev function run locally not on lambda? That’s explins my other issue of getting totally confused when the JavaScript ?? operator worked locally but errored on deployed - even though I set nvm to install node 14 (where ?? was supported! Hopeulyl lambda will up their node version soon.

Yes, totally. The goal is actually that everything about Netlify’s systems would run locally when you run Netlify Dev! Auth is one of the very few things that doesn’t actually run locally when running Dev (that may change in the future, TBD).

The ?? op is actually a good example of that. Since AWS limits its Node runtimes to v10 and v12, the ?? will not work on deployed Functions but may work locally depending on your local node version.

I would encourage you to put it back in and play around with it. It should definitely be working. I think utilizing private tabs may help there. Let me know how it goes :+1:t2:

1 Like

It seems to be forms not submitting correctly form dev - fine on deployment

Forms is another :confused: Should’ve mentioned that

Though for Auth a workaround is provided by hooking up the deployment URL. I wonder if Forms could be similar

Related to forms, are there any SLAs? eg how long the hang around, plus attached files etc?

That’s a good idea. You could actually probably use the redirects engine locally to reroute any form submits up to your prod site endpoint and it would likely work fine :100: haven’t tried that before but there’s nothing stopping you there!

I don’t know the SLA information off hand but I don’t think form submissions get removed or deleted.

I’m not sure you could proxy Form submissions since, unlike Identity, there is no ‘live’ instance listening for submissions. We have static form definitions based on the lates deploy. If you haven’t deployed your form yet, then there won’t be a form definition.

Regarding SLAs, we don’t delete/remove form submissions. Manually deleting the submission is the only way to remove it from our system.

Hope that helps!

1 Like

Yes it does help. Thanks again.

Regarding SLAs, we don’t delete/remove form submissions. Manually deleting the submission is the only way to remove it from our system.

Does that apply to files attached to forms too?

I notice they are effectively exposed on public URIs- though pretty obscure ones

Yup, it applies to attached files as well.

1 Like