D
Deno

help

deno behaving differently in local dev env and production docker builds

LLunarequest9/14/2023
I'm currently trying to switch from using node+yarn 2 for my blogs static files to deno. however the tasks that work locally for me fail to run properly in my container buildenv. I've even tried to use the curl | sh installer but the same behaviour persists. npm packages have trouble resolving deps which does not happen in my local dev env. Am i missing something?
DAHDeno AI Helper9/14/2023
It sounds like you're experiencing some differences between your local development environment and your Docker build environment. This could be due to a variety of factors. Here are a few things you might want to check based on the documentation: 1. Deno version: Ensure that the Deno version you're using in your Docker build environment is the same as your local development environment. Differences in Deno versions could lead to different behaviors. 2. Dockerfile configuration: Check your Dockerfile to ensure it's correctly set up for Deno. The documentation provides an example Dockerfile for a Deno project. Make sure you're setting the WORKDIR, copying your project files into the Docker image, and caching your dependencies with deno cache. 3. Permissions: Deno is secure by default and requires explicit permissions for certain operations. If your tasks are failing, it could be due to missing permissions in your Docker environment. Make sure you're providing the necessary permissions with flags like --allow-read, --allow-net, etc. 4. npm dependencies: If you're using npm packages in your Deno project, there could be compatibility issues. Deno has experimental support for npm specifiers, but it's still under development and you might encounter scenarios where something doesn't work. If you're using npm packages, make sure to run your Deno command with the --unstable and --A flags. 5. Lock file: Deno uses a lock file to ensure the integrity of dependencies. If you're using a lock file, make sure it's correctly set up and included in your Docker image. If you've checked all of these and are still experiencing issues, it might be helpful to provide more specific error messages or details about the tasks that are failing. This could help
DAHDeno AI Helper9/14/2023
identify if there's a specific issue with your setup. 🦕
LLunarequest9/14/2023
see the issue isn't with npm deps directly but rather with deps of npm deps. for example I use tailwindcss as a postcss plugin, but it can't find @alloc/quick-lru and so on, I'm a bit confused to as why it works with some deps eg chalk works just fine but not others the full error output is here. I'm using a tool called melange to build my container. hence the :warning: x86_64 | bits
:warning: x86_64 | Require stack:
:warning: x86_64 | - /home/build/static_src/node_modules/.deno/tailwindcss@3.3.3/node_modules/tailwindcss/lib/lib/setupTrackingContext.js
:warning: x86_64 | - /home/build/static_src/node_modules/.deno/tailwindcss@3.3.3/node_modules/tailwindcss/lib/plugin.js
:warning: x86_64 | - /home/build/static_src/node_modules/.deno/tailwindcss@3.3.3/node_modules/tailwindcss/lib/index.js
:warning: x86_64 | - /home/build/static_src/node_modules/.deno/tailwindcss@3.3.3/node_modules/tailwindcss/lib/index.js
:warning: x86_64 | at Function.Module._resolveFilename (node:module:624:15)
:warning: x86_64 | at Function.Module._load (node:module:502:27)
:warning: x86_64 | at Module.require (node:module:677:19)
:warning: x86_64 | at require (node:module:791:16)
:warning: x86_64 | at Object.<anonymous> (file:///home/build/static_src/node_modules/.deno/tailwindcss@3.3.3/node_modules/tailwindcss/lib/lib/setupTrackingContext.js:17:58)
:warning: x86_64 | at Object.<anonymous> (file:///home/build/static_src/node_modules/.deno/tailwindcss@3.3.3/node_modules/tailwindcss/lib/lib/setupTrackingContext.js:168:4)
:warning: x86_64 | at Module._compile (node:module:733:34)
:warning: x86_64 | at Object.Module._extensions..js (node:module:747:10)
:warning: x86_64 | at Module.load (node:module:658:32)
:warning: x86_64 | at Function.Module._load (node:module:539:12)
2023/09/14 11:24:22 ERROR: failed to build package. the build environment has been preserved:
:information_source: x86_64 | workspace dir: /tmp/melange-workspace-678298445
:information_source: x86_64 | guest dir: /tmp/melange-guest-866380308
2023/09/14 11:24:22 error during command execution: failed to build package: unable to run pipeline: exit status 1
:warning: x86_64 | Require stack:
:warning: x86_64 | - /home/build/static_src/node_modules/.deno/tailwindcss@3.3.3/node_modules/tailwindcss/lib/lib/setupTrackingContext.js
:warning: x86_64 | - /home/build/static_src/node_modules/.deno/tailwindcss@3.3.3/node_modules/tailwindcss/lib/plugin.js
:warning: x86_64 | - /home/build/static_src/node_modules/.deno/tailwindcss@3.3.3/node_modules/tailwindcss/lib/index.js
:warning: x86_64 | - /home/build/static_src/node_modules/.deno/tailwindcss@3.3.3/node_modules/tailwindcss/lib/index.js
:warning: x86_64 | at Function.Module._resolveFilename (node:module:624:15)
:warning: x86_64 | at Function.Module._load (node:module:502:27)
:warning: x86_64 | at Module.require (node:module:677:19)
:warning: x86_64 | at require (node:module:791:16)
:warning: x86_64 | at Object.<anonymous> (file:///home/build/static_src/node_modules/.deno/tailwindcss@3.3.3/node_modules/tailwindcss/lib/lib/setupTrackingContext.js:17:58)
:warning: x86_64 | at Object.<anonymous> (file:///home/build/static_src/node_modules/.deno/tailwindcss@3.3.3/node_modules/tailwindcss/lib/lib/setupTrackingContext.js:168:4)
:warning: x86_64 | at Module._compile (node:module:733:34)
:warning: x86_64 | at Object.Module._extensions..js (node:module:747:10)
:warning: x86_64 | at Module.load (node:module:658:32)
:warning: x86_64 | at Function.Module._load (node:module:539:12)
2023/09/14 11:24:22 ERROR: failed to build package. the build environment has been preserved:
:information_source: x86_64 | workspace dir: /tmp/melange-workspace-678298445
:information_source: x86_64 | guest dir: /tmp/melange-guest-866380308
2023/09/14 11:24:22 error during command execution: failed to build package: unable to run pipeline: exit status 1
in the end I had to specifically delete the node_modules & deno.lock

Looking for more? Join the community!

Recommended Posts
Front end dev needed for 6 months.Hello. I am in need of a frontend developer. dm me pls.Include platform and version in compiled binary filenameRight now when i run `deno compile --output bin/myprogram`, it works as expected. Is is possible to How to handle a user abort by Deno.serveHello, I have a question and discovered this Discord channel now. The Deno website has an example atAPI hooks during restart for deno run --watchHello! I thought it would be super fun to further minimize repetitive tasks while manually testing adeno compile -A npm:cowsay not workingHello, I am trying `deno compile -A npm:cowsay` and then following that with `./cowsay Hello World!`compiling issue with import { WebSocketServer } from "npm:ws@^8.14.1"Using this impot in a "deno run --unstable [etc...]" env works flawless / as intended but trying to Is there any way to get Deno to not statically analyze import()?I understand that statically analyzing and fetching dynamic import() calls is a good thing for perfoUsing Deno in Frontend.Hey, I was wandering if it is possible to use Deno for Vanilla Frontend development. I dont want to Excluding certain directories when using "walk"Hello, I'm writing a script that should crawl through a directory and search for a given text insideSyntax Error: Unexpected token 'export'Hello, We are using Supabase Deno Edge Functions and are getting this error while trying to import aDeno Deploy QuestionsHey there. We are using Supabase to run edge functions, which in turn built their feature on top of Bunle OAK static assets to the compiled binaryHi, I am currently switching from NodeJS to Deno, and so far so good! One of the reasons for this s