Isaac McFadyen | YYZ01
03/13/2022, 10:57 PMwrangler pages dev --proxy=3000 -- npm run dev
Isaac McFadyen | YYZ01
03/13/2022, 10:57 PMbalage
03/13/2022, 10:58 PMIsaac McFadyen | YYZ01
03/13/2022, 10:58 PM@alpha
. But one sec, let me check one more thing.Isaac McFadyen | YYZ01
03/13/2022, 10:59 PMIsaac McFadyen | YYZ01
03/13/2022, 10:59 PMnpx wrangler@alpha pages dev ./.svelte-kit/cloudflare
Isaac McFadyen | YYZ01
03/13/2022, 10:59 PM.
in front of svelte-kit
there)balage
03/13/2022, 11:02 PMbalage
03/13/2022, 11:02 PMIsaac McFadyen | YYZ01
03/13/2022, 11:07 PMBytesource
03/14/2022, 8:46 AMimport { Creds } from '../credentials';
(credentials being located at functions/credentials.ts) works with locally with wrangler but fails on the server with [ERROR] Could not resolve "../_credentials"
. Is importing ts
files not supported?Isaac McFadyen | YYZ01
03/14/2022, 1:35 PMIsaac McFadyen | YYZ01
03/14/2022, 3:42 PMIsaac McFadyen | YYZ01
03/14/2022, 3:42 PMesbuild
?James
03/14/2022, 4:00 PMwrangler pages functions build
uses esbuild under the hood - not sure if you mean manually building yourself or something though?Isaac McFadyen | YYZ01
03/14/2022, 4:01 PMesbuild-plugin-alias
.Isaac McFadyen | YYZ01
03/14/2022, 4:01 PMsimpson
03/14/2022, 4:57 PMIsaac McFadyen | YYZ01
03/14/2022, 5:20 PMsimpson
03/14/2022, 5:44 PMBytesource
03/15/2022, 1:47 AM16:26:11.597 ✘ [ERROR] Could not resolve "../credentials.ts"
16:26:11.597 ../../../buildhome/repo/functions/contact/index.ts:3:22:
16:26:11.597 3 │ import { Creds } from '../credentials.ts';
Isaac McFadyen | YYZ01
03/15/2022, 2:02 AM.js
Isaac McFadyen | YYZ01
03/15/2022, 2:03 AM.js
, so it's probably trying to import an non-existent file.Bytesource
03/15/2022, 2:46 AMcredentials.js
is indeed working. It's just that I wanted to use Typescript with all files.
Do you know if importing `ts `files is possible with Cloudflare Functions?Isaac McFadyen | YYZ01
03/15/2022, 2:47 AM.js
should work with typescript.Isaac McFadyen | YYZ01
03/15/2022, 2:47 AM.ts
Isaac McFadyen | YYZ01
03/15/2022, 2:47 AM.ts
doesn't work because after compilation there is no .ts
files.Isaac McFadyen | YYZ01
03/15/2022, 2:47 AM.ts
files (except if your bundler transforms it to a .js
when building).Bytesource
03/15/2022, 2:51 AM.js
into a .ts
file works. The problem is that when importing a .js
file, this file's contents cannot be written in Typescript. Or am I missing something?