Industrial
Industrial
Explore posts from servers
DDeno
Created by Industrial on 11/2/2023 in #help
Deno.serve().shutdown doesn't exist?
const server = Deno.serve({
hostname,
port,
})
server.shutdown()
const server = Deno.serve({
hostname,
port,
})
server.shutdown()
error: TS2339 [ERROR]: Property 'shutdown' does not exist on type 'Server'.
server.shutdown()
error: TS2339 [ERROR]: Property 'shutdown' does not exist on type 'Server'.
server.shutdown()
Running Deno 1.37.2
7 replies
DDeno
Created by Industrial on 10/23/2023 in #help
VSCode Test Debugging
{
"name": "Test",
"request": "launch",
"type": "node",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "deno",
"runtimeArgs": [
"test",
"--unstable",
"--inspect-brk",
"--allow-all"
],
"attachSimplePort": 9229
}
{
"name": "Test",
"request": "launch",
"type": "node",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "deno",
"runtimeArgs": [
"test",
"--unstable",
"--inspect-brk",
"--allow-all"
],
"attachSimplePort": 9229
}
This doesn't work unless I add:
"program": "${workspaceFolder}/src/foo/bar.test.ts",
"program": "${workspaceFolder}/src/foo/bar.test.ts",
When I run without, I see that a process starts but it does nothing. How do I run all tests with a debugger? I just want to set a breakpoint and press run. I don't want to have to edit the config to test 1 specific file.
3 replies
DDeno
Created by Industrial on 9/7/2023 in #help
Error running Apollo example (on latest version)
Hi. When I run this example with the latest version of apollo from npm I get errors: https://deno.land/manual@v1.36.4/node/how_to_with_npm/apollo I tried removing the version to get the latest version and it pulled 4.9.3 which gave this error:
{"errors":[{"message":"Error loading package.json at /home/tom/Code/code9/node/test-fp-ls/node_modules/.deno/@apollo+utils.createhash@2.0.1/node_modules/sha.js/sha.js/package.json. Not a directory (os error 20)","extensions":{"code":"INTERNAL_SERVER_ERROR","stacktrace":["Error: Error loading package.json at /home/tom/Code/code9/node/test-fp-ls/node_modules/.deno/@apollo+utils.createhash@2.0.1/node_modules/sha.js/sha.js/package.json. Not a directory (os error 20)"," at resolveExports (internal:deno_node_loading/02_require.js:318:14)"," at Function.Module._findPath (internal:deno_node_loading/02_require.js:357:31)"," at Function.Module._resolveFilename (internal:deno_node_loading/02_require.js:618:27)"," at Function.Module._load (internal:deno_node_loading/02_require.js:467:27)"," at Module.require (internal:deno_node_loading/02_require.js:678:19)"," at require (internal:deno_node_loading/02_require.js:818:16)"," at createHash (file:///home/tom/Code/code9/node/test-fp-ls/node_modules/.deno/@apollo+utils.createhash@2.0.1/node_modules/@apollo/utils.createhash/dist/index.js:9:12)"," at Object.html (file:///home/tom/Code/code9/node/test-fp-ls/node_modules/.deno/@apollo+server@4.9.3/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/index.js:67:29)"," at ApolloServer.executeHTTPGraphQLRequest (file:///home/tom/Code/code9/node/test-fp-ls/node_modules/.deno/@apollo+server@4.9.3/node_modules/@apollo/server/dist/esm/ApolloServer.js:480:77)"]}}]}
{"errors":[{"message":"Error loading package.json at /home/tom/Code/code9/node/test-fp-ls/node_modules/.deno/@apollo+utils.createhash@2.0.1/node_modules/sha.js/sha.js/package.json. Not a directory (os error 20)","extensions":{"code":"INTERNAL_SERVER_ERROR","stacktrace":["Error: Error loading package.json at /home/tom/Code/code9/node/test-fp-ls/node_modules/.deno/@apollo+utils.createhash@2.0.1/node_modules/sha.js/sha.js/package.json. Not a directory (os error 20)"," at resolveExports (internal:deno_node_loading/02_require.js:318:14)"," at Function.Module._findPath (internal:deno_node_loading/02_require.js:357:31)"," at Function.Module._resolveFilename (internal:deno_node_loading/02_require.js:618:27)"," at Function.Module._load (internal:deno_node_loading/02_require.js:467:27)"," at Module.require (internal:deno_node_loading/02_require.js:678:19)"," at require (internal:deno_node_loading/02_require.js:818:16)"," at createHash (file:///home/tom/Code/code9/node/test-fp-ls/node_modules/.deno/@apollo+utils.createhash@2.0.1/node_modules/@apollo/utils.createhash/dist/index.js:9:12)"," at Object.html (file:///home/tom/Code/code9/node/test-fp-ls/node_modules/.deno/@apollo+server@4.9.3/node_modules/@apollo/server/dist/esm/plugin/landingPage/default/index.js:67:29)"," at ApolloServer.executeHTTPGraphQLRequest (file:///home/tom/Code/code9/node/test-fp-ls/node_modules/.deno/@apollo+server@4.9.3/node_modules/@apollo/server/dist/esm/ApolloServer.js:480:77)"]}}]}
3 replies
DDeno
Created by Industrial on 9/7/2023 in #help
Error running program that uses `fp-ts` from npm (`Is a directory (os error 21)`)
https://github.com/Industrial/test-fp-ls/blob/main/mod.ts When I run deno run -A mod.ts I get:
error: Unable to load /home/tom/Code/code9/node/test-fp-ls/node_modules/.deno/fp-ts@2.16.1/node_modules/fp-ts/Option imported from file:///home/tom/Code/code9/node/test-fp-ls/mod.ts

Caused by:
Is a directory (os error 21)
error: Unable to load /home/tom/Code/code9/node/test-fp-ls/node_modules/.deno/fp-ts@2.16.1/node_modules/fp-ts/Option imported from file:///home/tom/Code/code9/node/test-fp-ls/mod.ts

Caused by:
Is a directory (os error 21)
Is my import_map.json wrong? https://github.com/Industrial/test-fp-ls/blob/main/import_map.json
4 replies
DDeno
Created by Industrial on 9/6/2023 in #help
Getting error trying to download NPM package
Download https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.6.0.tgz
Download https://registry.npmjs.org/@typescript-eslint/types/-/types-6.6.0.tgz
Download https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.6.0.tgz
Download https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.6.0.tgz
Download https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.6.0.tgz
error: Uncaught Error: Trying to import ESM module: /home/tom/Code/code9/node/test-fp-ls/node_modules/.deno/ts-api-utils@1.0.2/node_modules/ts-api-utils/lib/index.js using require()
at Object.Module._extensions..js (internal:deno_node_loading/02_require.js:774:13)
at Module.load (internal:deno_node_loading/02_require.js:656:32)
at Function.Module._load (internal:deno_node_loading/02_require.js:513:12)
at Module.require (internal:deno_node_loading/02_require.js:678:19)
at require (internal:deno_node_loading/02_require.js:818:16)
at Object.<anonymous> (file:///home/tom/Code/code9/node/test-fp-ls/node_modules/.deno/@typescript-eslint+typescript-estree@6.6.0/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.js:27:30)
at Object.<anonymous> (file:///home/tom/Code/code9/node/test-fp-ls/node_modules/.deno/@typescript-eslint+typescript-estree@6.6.0/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.js:64:4)
at Module._compile (internal:deno_node_loading/02_require.js:745:34)
at Object.Module._extensions..js (internal:deno_node_loading/02_require.js:778:10)
at Module.load (internal:deno_node_loading/02_require.js:656:32)
Download https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.6.0.tgz
Download https://registry.npmjs.org/@typescript-eslint/types/-/types-6.6.0.tgz
Download https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.6.0.tgz
Download https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.6.0.tgz
Download https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.6.0.tgz
error: Uncaught Error: Trying to import ESM module: /home/tom/Code/code9/node/test-fp-ls/node_modules/.deno/ts-api-utils@1.0.2/node_modules/ts-api-utils/lib/index.js using require()
at Object.Module._extensions..js (internal:deno_node_loading/02_require.js:774:13)
at Module.load (internal:deno_node_loading/02_require.js:656:32)
at Function.Module._load (internal:deno_node_loading/02_require.js:513:12)
at Module.require (internal:deno_node_loading/02_require.js:678:19)
at require (internal:deno_node_loading/02_require.js:818:16)
at Object.<anonymous> (file:///home/tom/Code/code9/node/test-fp-ls/node_modules/.deno/@typescript-eslint+typescript-estree@6.6.0/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.js:27:30)
at Object.<anonymous> (file:///home/tom/Code/code9/node/test-fp-ls/node_modules/.deno/@typescript-eslint+typescript-estree@6.6.0/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.js:64:4)
at Module._compile (internal:deno_node_loading/02_require.js:745:34)
at Object.Module._extensions..js (internal:deno_node_loading/02_require.js:778:10)
at Module.load (internal:deno_node_loading/02_require.js:656:32)
The package I'm trying to install is @typescript-eslint/parser.
1 replies
DDeno
Created by Industrial on 9/3/2023 in #help
Get Deno working with ESLint
2 replies
DDeno
Created by Industrial on 6/5/2023 in #help
File Permissions on Deno.FileInfo
Hello. As a programming exercise I'm trying to convert a Decimal number into Octal and that Octal representation into a Unix File Permission representation (drwx-). * I have a directory with the number 16877 -> 40755 * I have a file with the number 33188 -> 100644 Questions: * Why does the first Octal number have 5 digits and the second one 6? * I understand the meaning of the last 3 digits, but I don't understand the meaning of the 40 and the 100. Should I interpret the number from right to left? According to ChatGPT: The leftmost digit represents the file type. It can have various values depending on the file type, such as: 0: Regular file 1: FIFO (named pipe) 2: Directory 3: Symbolic link 4: Socket 5: Block device 6: Character device If that's true why is my directory giving me a mode of 4 i.e. Socket and not 2 (Directory)?
5 replies
DDeno
Created by Industrial on 10/22/2022 in #help
Simple test, lots of type errors
Hi! I made a library for Deno (https://github.com/Industrial/fresh-emotion) and am now trying to add tests. When I run this test: https://github.com/Industrial/fresh-emotion/blob/main/mod.test.ts I get this output:
error: TS6200 [ERROR]: Definitions of the following identifiers conflict with those in another file: CompileError, Global, Instance, LinkError, Memory, Module, RuntimeError, Table, ImportExportKind, TableKind, ValueType, ExportValue, Exports, ImportValue, ModuleImports, Imports, BufferSource, ErrorEvent, PromiseRejectionEvent, Worker, PerformanceEntryList, Performance, PerformanceEntry, PerformanceMark, PerformanceMeasure, CustomEvent
interface AddEventListenerOptions extends EventListenerOptions {
~~~~~~~~~
at asset:///lib.dom.d.ts:26:1

Conflicts are in this file.
declare namespace WebAssembly {
~~~~~~~
at asset:///lib.deno.shared_globals.d.ts:17:1

TS6200 [ERROR]: Definitions of the following identifiers conflict with those in another file: DOMException, Event, EventTarget, EventListenerOrEventListenerObject, ProgressEvent, AbortController, BlobPart, Blob, File, ReadableStreamReadResult, ReadableStreamReader, size, MessageEvent, Transferable, MessageChannel, MessagePort
interface AddEventListenerOptions extends EventListenerOptions {
~~~~~~~~~
at asset:///lib.dom.d.ts:26:1

Conflicts are in this file.
declare class DOMException extends Error {
~~~~~~~
at asset:///lib.deno.web.d.ts:9:1
error: TS6200 [ERROR]: Definitions of the following identifiers conflict with those in another file: CompileError, Global, Instance, LinkError, Memory, Module, RuntimeError, Table, ImportExportKind, TableKind, ValueType, ExportValue, Exports, ImportValue, ModuleImports, Imports, BufferSource, ErrorEvent, PromiseRejectionEvent, Worker, PerformanceEntryList, Performance, PerformanceEntry, PerformanceMark, PerformanceMeasure, CustomEvent
interface AddEventListenerOptions extends EventListenerOptions {
~~~~~~~~~
at asset:///lib.dom.d.ts:26:1

Conflicts are in this file.
declare namespace WebAssembly {
~~~~~~~
at asset:///lib.deno.shared_globals.d.ts:17:1

TS6200 [ERROR]: Definitions of the following identifiers conflict with those in another file: DOMException, Event, EventTarget, EventListenerOrEventListenerObject, ProgressEvent, AbortController, BlobPart, Blob, File, ReadableStreamReadResult, ReadableStreamReader, size, MessageEvent, Transferable, MessageChannel, MessagePort
interface AddEventListenerOptions extends EventListenerOptions {
~~~~~~~~~
at asset:///lib.dom.d.ts:26:1

Conflicts are in this file.
declare class DOMException extends Error {
~~~~~~~
at asset:///lib.deno.web.d.ts:9:1
And many more errors like it. How do I solve this? Is this due to Fresh / Preact ?
1 replies
DDeno
Created by Industrial on 10/1/2022 in #help
How do I patch a std api?
Hello. This person posted in this command that they "patched" the vm.isContext function to return false in order to get the node:jsdom library to work: https://github.com/denoland/fresh/issues/427#issuecomment-1251918545 I am wondering how they did that. I tried this:
import * as vm from "std/node/vm.ts";
vm.isContext = () => false;
import * as vm from "std/node/vm.ts";
vm.isContext = () => false;
But this throws the error:
error: TypeError: Cannot assign to read only property 'isContext' of object '[object Module]'
error: TypeError: Cannot assign to read only property 'isContext' of object '[object Module]'
7 replies