D
Deno

help

esbuild-deno-loader with npm private registry

MMariusVatasoiu3/19/2024
Did anyone used the esbuild-deno-loader with npm: specifier while using a private npm registry that requires authentication? Does Deno use the npmrc in any way? I saw the option to set a custom registry, but what about the credentials? I'm getting the "Module not found" error and not sure why. I have the feeling it's a network issue, but the error is too vague.
Mmarvinh.3/19/2024
npm stores auth tokens in .npmrc in the users home dir afaik. Could be that the esbuild deno loader isn't respecting that
MMariusVatasoiu3/19/2024
Is this something that the loader should do or the runtime itself?
Mmarvinh.3/19/2024
I'm not familiar enough with the internals of esbuild loader to guess if the problem is there or in deno
MMariusVatasoiu3/19/2024
I'm using Luca's plugin: https://github.com/lucacasonato/esbuild_deno_loader But from the source code I don't see anything related with the npmrc file
GitHub
GitHub - lucacasonato/esbuild_deno_loader: Deno module resolution f...
Deno module resolution for esbuild. Contribute to lucacasonato/esbuild_deno_loader development by creating an account on GitHub.
MMariusVatasoiu3/19/2024
And, since the npm: specifier is built in the runtime, I'm expecting to be some config related with the runtime my deno.json looks somthing like this:
{
"imports": {
"lit": "npm:lit@^2.0.0"
}
}
{
"imports": {
"lit": "npm:lit@^2.0.0"
}
}
// buil.ts
import * as esbuild from 'npm:esbuild@0.20.2';
// Import the WASM build on platforms where running subprocesses is not
// permitted, such as Deno Deploy, or when running without `--allow-run`.
// import * as esbuild from "https://deno.land/x/esbuild@0.20.2/wasm.js";

import { denoPlugins } from 'jsr:@luca/esbuild-deno-loader@^0.10.3';

const result = await esbuild.build({
plugins: [...denoPlugins()],
entryPoints: ['./static/index.js'],
outfile: './dist/static.esm.js',
bundle: true,
format: 'esm'
});

console.log(result.outputFiles);

esbuild.stop();
// buil.ts
import * as esbuild from 'npm:esbuild@0.20.2';
// Import the WASM build on platforms where running subprocesses is not
// permitted, such as Deno Deploy, or when running without `--allow-run`.
// import * as esbuild from "https://deno.land/x/esbuild@0.20.2/wasm.js";

import { denoPlugins } from 'jsr:@luca/esbuild-deno-loader@^0.10.3';

const result = await esbuild.build({
plugins: [...denoPlugins()],
entryPoints: ['./static/index.js'],
outfile: './dist/static.esm.js',
bundle: true,
format: 'esm'
});

console.log(result.outputFiles);

esbuild.stop();
MMariusVatasoiu3/19/2024
My problem might be related with https://github.com/denoland/deno/issues/19900 I think I can't use a private npm registry that requires auth.
GitHub
DENO_AUTH_TOKENS does not authenticate against npm.pkg.github.com ·...
Hi, I'm doing a POC to see if our company can start replacing node with deno. I have a private npm package in npm.pkg.github.com that I'm trying to import. I'm trying to run a single-li...

Looking for more? Join the community!

Recommended Posts
how to load env variables from .env file in taskthe `source` shell command is not available. I tried ``` "tasks": { "my-task": "export .env &&Is there a way to specify a range and list from KV?```typescript const kv = await Deno.openKv(); kv.set(["parent", 1], "key1") kv.set(["parent", 2], "kPermissionDenied while using ioredis npm packageHello, I'm facing an issue with an npm library ioredis (https://github.com/redis/ioredis). For someIs there a way to obtain Deno.cron schedule info?Deploy lists the registered cron jobs with name, schedule, last run and next run. Is there a programVisual Studio Code Deno does not use node typesI'm trying to use the "esquery" node library with its types, but for any reason Deno ignores the typDrop permissionsI'd like to harden my deno app a bit, but specifying permissions manually gets repetitive. Is there New fresh project comes out of the box with errorsI created a new fresh project on linux, I am using VsCode and im getting many errors although the prIs there a deno function for inputting prompt reply without pressing enter?Normally, one has to press enter for the input to be accepted. I was wondering if there was a versioSetting Deno.Command priority and affinity (on windows)Is it possible to set a tasks / commands priority and affinity directly? Code: ```ts await new DenoIs there a way to write a Deno.AtomicCheck that succeeds for any non-null versionstamp?You can write a Deno.AtomicCheck that fails if the versionstamp for a key-value pair in the KV storeImportTypeScript API + get value of `compilerOptions` with default options from `tsconfig.json`?Hello, I'm trying to figure out the proper way to do a few things: 1. What's the correct way to impHow to override the version from a dependency of a project's dependency from npmI'm currently using react-pdf as a dependency, react-pdf uses fontkit as a dependency, and fontkit uHow to publish global types with JSR?I was trying to republish my npm package with JSR via npm jsr package. It all went well with one excCaching results from APIHi, I'm currently working on a project where I get data from an API (https://www.robotevents.com/apiINTERNAL_SERVER_ERROR_2 / 500 response codeSeveral clients concurrently reported INTERNAL_SERVER_ERROR_2 with a 500 error on requests to a deplMy site seems to be under attackI receive a large amount of request last night. Does this mean my site is under attack...?