-
-
Save kitsonk/b75a862f0795e09363d4f230c02b48b5 to your computer and use it in GitHub Desktop.
deno issue 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <reference no-default-lib="true"/> | |
/// <reference lib="deno.ns" /> | |
/// <reference lib="deno.unstable" /> | |
/// <reference lib="dom" /> | |
/// <reference lib="dom.iterable" /> | |
/// <reference lib="dom.asynciterable" /> | |
import { Application } from "https://deno.land/x/oak/mod.ts"; | |
import staticFiles from "https://deno.land/x/static_files/mod.ts"; | |
import { | |
init as initTw, | |
TwInfo, | |
generate as generateTw | |
} from "https://deno.land/x/twd/mod.ts"; | |
export const bundle = async () => { | |
const { files, diagnostics } = await Deno.emit("./frontend/src/main.tsx", { | |
bundle: "module", | |
importMapPath: "./import_map.json" | |
}); | |
// if dist folder doesn't exist, create it | |
try { | |
await Deno.stat("public"); | |
} catch { | |
await Deno.mkdir("public", { recursive: true }); | |
} | |
const bundle = files["deno:///bundle.js"]; | |
const config = await import("./twind.config.ts"); | |
const info: TwInfo = initTw(config.default); | |
const sheet = generateTw([bundle], info); | |
// write files to dist folder | |
await Deno.writeTextFile("public/bundle.css", sheet); | |
await Deno.writeTextFile("public/bundle.js", files["deno:///bundle.js"]); | |
}; | |
await bundle(); | |
const app = new Application(); | |
app.use(staticFiles("public")); | |
await app.listen({ port: parseInt(Deno.env.get("PORT") ?? "3000") }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deno run --unstable -A bundler.ts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Check file:///home/theo/dev/deno-slabchat/frontend/bundler.ts | |
error: TS7053 [ERROR]: Element implicitly has an 'any' type because expression of type 'unique symbol' can't be used to index type 'ReadableStream<NativeRequest>'. | |
Property '[SymbolConstructor.asyncIterator]' does not exist on type 'ReadableStream<NativeRequest>'. | |
return stream[Symbol.asyncIterator](); | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
at https://deno.land/x/[email protected]/http_server_native.ts:281:12 | |
TS2339 [ERROR]: Property 'entries' does not exist on type 'Headers'. | |
for (const [key, value] of response.headers.entries()) { | |
~~~~~~~ | |
at https://deno.land/x/[email protected]/cookies.ts:297:49 | |
TS2488 [ERROR]: Type 'Headers' must have a '[Symbol.iterator]()' method that returns an iterator. | |
for (const [key, value] of headers) { | |
~~~~~~~ | |
at https://deno.land/x/[email protected]/server_sent_event.ts:243:34 | |
TS2488 [ERROR]: Type 'Headers' must have a '[Symbol.iterator]()' method that returns an iterator. | |
for (const [key, value] of responseHeaders) { | |
~~~~~~~~~~~~~~~ | |
at https://deno.land/x/[email protected]/server_sent_event.ts:247:32 | |
TS2339 [ERROR]: Property 'keys' does not exist on type 'Headers'. | |
for (const key of [...context.response.headers.keys()]) { | |
~~~~ | |
at https://deno.land/x/[email protected]/application.ts:328:52 | |
TS2339 [ERROR]: Property 'entries' does not exist on type 'Headers'. | |
return headers.entries(); | |
~~~~~~~ | |
at https://deno.land/x/[email protected]/middleware/proxy.ts:202:20 | |
TS2488 [ERROR]: Type 'Headers' must have a '[Symbol.iterator]()' method that returns an iterator. | |
for (const [key, value] of response.headers) { | |
~~~~~~~~~~~~~~~~ | |
at https://deno.land/x/[email protected]/middleware/proxy.ts:228:30 | |
TS2488 [ERROR]: Type 'URLSearchParams' must have a '[Symbol.iterator]()' method that returns an iterator. | |
for (const [key, value] of ctx.request.url.searchParams) { | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
at https://deno.land/x/[email protected]/helpers.ts:43:30 | |
TS2339 [ERROR]: Property 'emit' does not exist on type 'typeof Deno'. 'Deno.emit' is an unstable API. Did you forget to run with the '--unstable' flag? | |
const { files, diagnostics } = await Deno.emit("./frontend/src/main.tsx", { | |
~~~~ | |
at file:///home/theo/dev/deno-slabchat/frontend/bundler.ts:10:45 | |
Found 9 errors. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// blank file that i created |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Config } from "https://deno.land/x/[email protected]/types.ts"; | |
const config: Config = {}; | |
export default config; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment