Birk Skyum
Birk Skyum
Explore posts from servers
DDeno
Created by Birk Skyum on 9/10/2024 in #help
canary `deno install` - can't find npm modules
deno 2.0.0-rc.1+7bfcb4d I'm having a deno.json like this
{
"tasks": {
"test": "vitest"
},
"imports": {
"vitest": "npm:vitest@^2.0.5"
}
}
{
"tasks": {
"test": "vitest"
},
"imports": {
"vitest": "npm:vitest@^2.0.5"
}
}
I run deno install I have a test like this:
import { expect, test } from "vitest"; // <- "Cannot find module 'vitest' or its corresponding type declarations.ts(2307)
function sum(a, b) {
return a + b
}
test('adds 1 + 2 to equal 3', () => {
expect(sum(1, 2)).toBe(3)
})
import { expect, test } from "vitest"; // <- "Cannot find module 'vitest' or its corresponding type declarations.ts(2307)
function sum(a, b) {
return a + b
}
test('adds 1 + 2 to equal 3', () => {
expect(sum(1, 2)).toBe(3)
})
Why can the type declarations not be found? deno install doesn't seem to make a node_modules folder by default - is that necessary for this this type to be found, or can the import mapping work? I also have the vitest.config.ts like this:
import {defineConfig} from "vitest/config";

export default defineConfig({
test: {
include: ['sum.test.ts']
}
})
import {defineConfig} from "vitest/config";

export default defineConfig({
test: {
include: ['sum.test.ts']
}
})
and when I run the task deno task test I get an error that "vitest/config" also can't be found:
deno task test
Task test vitest
[ERROR] Unterminated string literal

vitest.config.ts:1:366:
1 │ ...e:///Users/admin/repos/deno-kitchensink/vitest-demo/vitest.config.ts";import {defineConfig} from "vitest/config';
╵ ^

failed to load config from /Users/admin/repos/deno-kitchensink/vitest-demo/vitest.config.ts
deno task test
Task test vitest
[ERROR] Unterminated string literal

vitest.config.ts:1:366:
1 │ ...e:///Users/admin/repos/deno-kitchensink/vitest-demo/vitest.config.ts";import {defineConfig} from "vitest/config';
╵ ^

failed to load config from /Users/admin/repos/deno-kitchensink/vitest-demo/vitest.config.ts
7 replies
SSolidJS
Created by Birk Skyum on 3/12/2024 in #support
Can't use import `assert {"type":"json"}``
whenever I try to import a .json document with the assert specified, i get errors about missing babel plugins, but I'm not able to add a babel plugin. Small repro here: https://github.com/birkskyum/solid-import-assertions
2 replies
DDeno
Created by Birk Skyum on 11/29/2023 in #help
Webgl2 in Deno i.e. for unit testing
nodejs has this challenge that there is no way to run webgl2 (or webgpu), i.e. for unit testing. There is a solution for webgl1, through the use of https://github.com/stackgl/headless-gl. Is there a way to run webgl2 in deno, headless?
6 replies
SSolidJS
Created by Birk Skyum on 11/21/2023 in #support
createResource - SSR / SPA
moved conversation here @Christian
18 replies
DDeno
Created by Birk Skyum on 11/12/2023 in #help
byonm - force use of Deno
When I use byonm enabled in my deno.json, and say I have a vite project triggered from a package.json with i.e. "deno task dev", it appears to just my code with Node.js underneath. Is there a way to force use of deno througout, somewhat similar to what bun has with --bun flag to overwrite uses of Node.js?
3 replies