Marc
Marc
Explore posts from servers
CDCloudflare Developers
Created by Marc on 9/4/2024 in #workers-help
Does sleeping/delaying count as CPU time?
For the sake of billing and timeout limits does "sleeping" or doing something like await new Promise(r => setTimeout(r, 60000)); count as CPU time. Like would a worker that uses this code be billed for 60000 ms of execution? If not is there a limit to how long we can sleep to keep a worker going? I have an API that needs to be polled and I want to know if workers can be used for it.
3 replies
RRailway
Created by Marc on 3/15/2024 in #✋|help
Help Switching to JSON Redis Stack
Hello there, I'm trying to use a version of Redis on railway with the JSON extension. I came across Brody's answer here and started to follow along: https://www.answeroverflow.com/m/1154090266093953065. Only issue is that the env variables didn't seem to carry over well. I had to change around some ports to get it to connect again but now it's not reading from the attached volume. All online help talks about changing the docker start command but the Build section is missing from the settings panel. How can I get it to connect to our existing volume?
53 replies
RRailway
Created by Marc on 10/27/2023 in #✋|help
Issue deploying Next.js 14 with server actions
I'm trying to deploy a project using the newly released next.js 14 from yesterday. I have everything working locally including dev and local production builds. The issue occurs during the build step on Railway where my build fails because of the Next.js error: To use Server Actions, please enable the feature flag in your Next.js config. Read more: https://nextjs.org/docs/app/building-your-application/data-fetching/forms-and-mutations#convention However, in Next 14 this option was removed as sever actions are now "stable". In fact locally the build will fail if you leave that feature flag enabled. This leads me to believe that nixpacks is potentially overriding my package.json next.js version. Or maybe a version 13 is stuck in our cache. Can anyone help me out. Thanks!
8 replies
RRailway
Created by Marc on 9/11/2023 in #✋|help
Issue Deploying Next.js 13 with Bun 1.0
For better or worse I've decided to follow the hype train and am trying to get Bun 1.0 working with my Next.js 13 project on railway. Prior to using Bun the project has been deploying perfectly fine. I have followed the many threads already made here about Bun and am using the special Nixpkgs archive to make sure I have bun 1.0 available. The funky thing is the project actually appears to build fine. Meaning there are no errors during the build. An image is produced and then it's deployed. The error only occurs during actually running the app when I get the following error:
next start -p process.env.PORT
- ready started server on localhost:34497, url: http://localhost:34497
ENOENT: No such file or directory
path: "/app/.next/BUILD_ID"
syscall: "open"
errno: -2
next start -p process.env.PORT
- ready started server on localhost:34497, url: http://localhost:34497
ENOENT: No such file or directory
path: "/app/.next/BUILD_ID"
syscall: "open"
errno: -2
This causes the deployment to error out and consider itself "completed" not "active". I have tried building then running the package locally on my M2 macbook and it works fine. The only final clue I can offer is that weirdly the output during the build step is missing the Next.js route type output. That part where it tells you what route will be what. SSR, Static, etc. It appears on my local computer, but not during the build on railway and it definitely used to when using pure yarn/node. However, it again does not produce and error, there's just no output:
#12 0.445 $ next build
#12 1.659 - warn You have enabled experimental features (serverActions, serverComponentsExternalPackages) in next.config.js.

#12 1.659 - warn Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use at your own risk.

#12 1.660
#12 1.943 - info Creating an optimized production build...
#12 DONE 30.9s


#13 [stage-0 9/10] RUN printf '\nPATH=/app/node_modules/.bin:$PATH' >> /root/.profile

#13 DONE 0.4s

#14 [stage-0 10/10] COPY . /app

#14 DONE 0.1s

#15 exporting to image
#15 exporting layers
#12 0.445 $ next build
#12 1.659 - warn You have enabled experimental features (serverActions, serverComponentsExternalPackages) in next.config.js.

#12 1.659 - warn Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use at your own risk.

#12 1.660
#12 1.943 - info Creating an optimized production build...
#12 DONE 30.9s


#13 [stage-0 9/10] RUN printf '\nPATH=/app/node_modules/.bin:$PATH' >> /root/.profile

#13 DONE 0.4s

#14 [stage-0 10/10] COPY . /app

#14 DONE 0.1s

#15 exporting to image
#15 exporting layers
70 replies
RRailway
Created by Marc on 8/15/2023 in #✋|help
Issue with deploy for Supabase Monorepo
I'm having an issue deploying my project which is a Supabase monorepo (Next.js + Supabase functions [Deno]). From reading the documentation (https://nixpacks.com/docs/providers/deno) I think the error is coming from this: 'Deno is detected if there is a deno.{json,jsonc} file found or if any .{ts,tsx,js,jsx} file is found that imports something from deno.land.' I do in fact have files that mention deno.land in my supabase functions monorepo folder. However this auto detection of Deno is breaking my builds for the Next.js side because the Nix builder thinks it's in a Deno project and then fails to find Yarn. Does anyone know of I was to override this behavior?
11 replies