Info level logging is not supported by Deno

Exploring Deno for the first time and in need of creating a logger. Encountered an unusual error message:

Error TS1205: Re-exporting a type with '--isolatedModules' flag requires 'export type'. export { LogLevels, LevelName } from "./levels.ts";

Desire to log INFO level only, attempted with this code snippet:

await log.setup({
    handlers: {
        console: new log.handlers.ConsoleHandler("INFO")
    }, 
    loggers: {
        default: {
            level: "INFO",
            handlers: ["console"],
        }
    }
})

UPDATE: Discovered using an outdated version of the log library. Made the import change from:

import * from "https://deno.land/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e4979080a4d4cad2d7cad4">[email protected]</a>/log/mod.ts"

to:

import * from "https://deno.land/std/log/mod.ts"

Answer №1

When configuring your tsconfig.json file:

    {
      "compilerOptions": {
        "isolatedModules": false
      }
    }

You can then run your code using:

    deno run -c tsconfig.json --allow-net --allow-read --unstable {your_entrypoint}.ts

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Understanding the attribute types in Typescript React

While working on code using Typescript + React, I encountered an error. Whenever I try to set type/value in the attribute of <a> tag, I receive a compile error. <a value='Hello' type='button'>Search</a> This piece o ...

React Native Component Error: Cannot read property '_this' of undefined

I am currently developing a face recognition application using React Native 0.63. I'm running my project using react-native run-android. However, I encountered an issue with Component Exception where it shows 'undefined is not an object (evaluati ...

Retrieve a specific property within a nested JSON object using a single string for reference

When I execute the line let X = this.appGlobal.GetNavigationLanguage().data;, it returns JSON data as shown below. https://i.sstatic.net/wdT4e.png I am trying to extract the string NAV.REPORTS.BMAIL.TITLE. The translation code (NAV.REPORTS.BMAIL.TITLE ...

Creating TypeScript atom packages

Has anyone successfully implemented this before? I couldn't locate any assistance for it. If someone could provide references to documentation or existing code, that would be great. I know that Atom runs on Node and that there is a TypeScript compil ...

What is the best way to implement react-password-checklist with zod?

I've been trying to utilize the react-password-checklist library to inform users if their password complies with the rules set in zod's schemaUser. However, I'm facing challenges in implementing this feature successfully. Note: I am using zo ...

Creating multiple dynamic dashboards using Angular 4 after user authentication

Is there a way to display a specific dashboard based on the user logged in, using Angular 4? For example: when USER1 logs in, I want dashboard 1 to be visible while hiding the others. Any help would be greatly appreciated... ...

Encountering a Typescript error with Next-Auth providers

I've been struggling to integrate Next-Auth with Typescript and an OAuth provider like Auth0. Despite following the documentation, I encountered a problem that persists even after watching numerous tutorials and mimicking their steps verbatim. Below i ...

Angular 4 is in need of CORS support

I have a server application with CORS enabled, which works well with my AngularJS client (1.x). However, I am now upgrading to Angular 4 and encountering the following error: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the rem ...

The action dispatched by 'AuthEffects.googleSignIn' is invalid because all Actions must include a type property

I am encountering the following issues: Effect "AuthEffects.googleSignIn" is triggering an invalid action: [object Object] Uncaught TypeError: Actions must have a type property You can view the errors below: https://i.sstatic.net/puY3q.png https://i.ss ...

Caution: Circular dependency has been identified in Angular 10 involving barrels

I keep getting a warning about circular dependencies when using barrelsby in Angular 10. Error: WARNING in Circular dependency detected: src\app\core\components\components.module.ts -> src\app\core\components\hea ...

Invoking a function on an immutable object

I have a code snippet that looks like this: private get headers(): Headers { const headers = new Headers(); headers.set('Authorization', `Bearer ${this.auth.tokenSnapshot}`); return headers; } The variable headers is defined as ...

Sending parameters in GraphQL with Typescript results in an empty set of curly braces being returned

I am new to learning GraphQL with Typescript and I am trying to pass an argument in a GraphQL function to return something dynamically. I have been struggling with this issue for the past hour and could not find any solutions. Here are the relevant code sn ...

TypeScript does not restrict generic types

Consider this scenario with a basic parser: const str = "String to test"; let pos = 0; function eat( ...args: ( | [RegExp, (result: RegExpExecArray) => boolean] | [string, (result: string) => boolean] | [string[], (result: num ...

React Native (or React) utilizes separate TypeScript modules to detect and respond to style adjustments for dark mode

Objective: Add a dark mode feature to a react native application. A brief overview of the system: File structure: Profile.ts ProfileCss.ts constants.ts In my app, I've organized styles in separate .ts files and exported them as modules to keep them ...

Using SystemJS to re-export modules does not function properly

Attempting to re-export modules according to the TypeScript language website - using SystemJS as the module loader: app.ts import * as s from "./AllValidators"; // Some samples to try let strings = ["Hello", "98052", "101"]; // Validators to use let v ...

Application: The initialization event in the electron app is not being triggered

I am facing an issue while trying to run my electron app with TypeScript and webpack. I have a main.ts file along with the compiled main.js file. To troubleshoot, I made some edits to the main.js file to verify if the "ready" function is being called. ...

Using a Google Cloud API that requires authentication without relying on a pre-existing client library

I'm facing some challenges while trying to deploy an application on GCP Marketplace due to the authentication documentation being unclear. According to the documentation, an OAuth scope of https://www.googleapis.com/auth/cloud-platform is necessary, w ...

Using TypeScript to implement Angular Draggable functionality within an ng-template

Sorry if this question has been asked before, but I couldn't find any information. I am trying to create a Bootstrap Modal popup with a form inside and I want it to be draggable. I have tried using a simple button to display an ng-template on click, b ...

Ensuring Consistency in Array Lengths of Two Props in a Functional Component using TypeScript

Is there a way to ensure that two separate arrays passed as props to a functional component in React have the same length using TypeScript, triggering an error if they do not match? For instance, when utilizing this component within other components, it sh ...

Extract the event.data value from a window.addEventListener (MessageEvent) in order to trigger a separate function

Currently, I am delving into Angular and aiming to develop a LinkedIn Login API. To achieve this, I'm utilizing window.open to launch a new window where the user can either accept or decline the authorization. Upon successful acceptance, LinkedIn retu ...