https://discord.cloudflare.com logo
Join Discord
Powered by
# functions
  • z

    zszszsz

    01/21/2023, 12:04 AM
    They say everything in local is local
  • z

    zszszsz

    01/21/2023, 12:06 AM
    Mine is like
    wrangler pages dev --port 8788 --d1 presentor --persist
  • t

    The Tank

    01/21/2023, 12:06 AM
    So that would mean I should run a database create command with the '--local' switch. then run my seeding command with the same switch 'wrangler d1 execute presentor --file=./database/tables/create-tables.sql --local'
  • t

    The Tank

    01/21/2023, 12:07 AM
    Hmm. you don't have the '--local' switch on your command :/
  • z

    zszszsz

    01/21/2023, 12:07 AM
    --local
    is said to be the default option
  • z

    zszszsz

    01/21/2023, 12:08 AM
    --local Run on my machine [boolean] [default: true]
  • t

    The Tank

    01/21/2023, 12:09 AM
    Odd. When I run 'wrangler d1 create presentor'. It create a new database in the cloud. So that suggests the create command doesn't conform to the same convention :/
  • t

    The Tank

    01/21/2023, 12:12 AM
    I wonder if it is because I'm logged in with wrangler and it just assumes everything to be the cloud from that point on :/
  • t

    The Tank

    01/21/2023, 12:12 AM
    Are you logged in?
  • z

    zszszsz

    01/21/2023, 12:13 AM
    I would say
  • z

    zszszsz

    01/21/2023, 12:13 AM
    maybe you should
    --d1 presentor
    instead of
    --d1=presentor
  • z

    zszszsz

    01/21/2023, 12:13 AM
    give it a try
  • t

    The Tank

    01/21/2023, 12:18 AM
    Tried 'wrangler pages dev ./functions --port 8788 --d1=presentor --persist' But still didn't find the binding 😦
  • t

    The Tank

    01/21/2023, 12:18 AM
    Sorry I true both ways
  • t

    The Tank

    01/21/2023, 12:18 AM
    with and without '='
  • z

    zszszsz

    01/21/2023, 12:21 AM
    wrangler pages dev --kv <kv> --d1 <d1> --persist --port 3000 --proxy 3001 --live-reload -- <proxied>
  • z

    zszszsz

    01/21/2023, 12:21 AM
    this is my whole command
  • t

    The Tank

    01/21/2023, 12:21 AM
    Are you running in docker? is that the reason for the proxy?
  • z

    zszszsz

    01/21/2023, 12:22 AM
    no not in docker, the proxy is just the frontend dev server
  • t

    The Tank

    01/21/2023, 12:23 AM
    Is the the name of your database, or the object attaches to the context.env object?
  • z

    zszszsz

    01/21/2023, 12:24 AM
    the object attaches to the context.env object, of course
  • z

    zszszsz

    01/21/2023, 12:24 AM
    if it is
    --d1 foo
    , then it is
    context.env.foo
  • t

    The Tank

    01/21/2023, 12:25 AM
    Okay so it just assumes the database that object should be pointing too. Cool. I'll have a play.
  • t

    The Tank

    01/21/2023, 1:16 AM
    Okay I think I worked it out. The command worked that you shared. What I had to do it add a wrangler.toml file to the root of the nuxt website, and confirm the D1 database in there. Once I done that, I was able to run my seeding SQL script with the --local switch. That populated the database for the ./functions. Now it's working like the hosted version.
  • w

    William.

    01/21/2023, 6:17 AM
    Sup all, does anybody know how to deploy functions with angular ? I get this build message :
    Note: No functions dir at /functions found. Skipping.
    But my functions works in wrangler, i've even included my functions folder into the /dist build output folder, which looks like screen below. I also tried using a bash script to build my project and cp function at the root of my project to the dist folder, but everytime the build logs says no functions dir was found, any idea ?
  • m

    monad

    01/21/2023, 6:18 AM
    I think
    functions
    has to be in root dir.
  • w

    William.

    01/21/2023, 6:19 AM
    Yeah it is, but it didnt work so I thought copying it into /dist would work but it doesn't
  • m

    monad

    01/21/2023, 6:19 AM
    I found this, have you look at it ? https://developers.cloudflare.com/pages/framework-guides/deploy-an-angular-application/
  • w

    William.

    01/21/2023, 6:20 AM
    My angular deployments are all working fine, it's just the functions that are not found for some reason, the link you shared does not mention functions
  • m

    monad

    01/21/2023, 6:21 AM
    Oh I see, it doesn't.
1...337338339...392Latest