cuibonobo / cuibonobo.com

A static site generator for cuibonobo.com
https://cuibonobo.com
Creative Commons Zero v1.0 Universal
0 stars 0 forks source link

`tsConfig` paths don't work on Cloudflare Pages #15

Closed cuibonobo closed 3 years ago

cuibonobo commented 3 years ago

I've tried remapping imports in tsconfig.json twice, but both times I've had trouble with the build on Cloudflare Pages. This must be an environment issue of some sort, but I haven't been able to get to the bottom of it.

Copying the logs here in case I want to figure this out someday:

23:45:17.818    Initializing build environment. This may take up to a few minutes to complete
23:45:52.194    Success: Finished initializing build environment
23:45:52.194    Cloning repository...
23:45:53.983    Success: Finished cloning repository files
23:45:54.244    Installing dependencies
23:45:54.263    Python version set to 2.7
23:45:57.479    Downloading and installing node v14.17.5...
23:45:57.633    Downloading https://nodejs.org/dist/v14.17.5/node-v14.17.5-linux-x64.tar.xz...
23:45:58.011    Computing checksum with sha256sum
23:45:58.115    Checksums matched!
23:46:00.240    Now using node v14.17.5 (npm v6.14.14)
23:46:00.277    Started restoring cached build plugins
23:46:00.278    Finished restoring cached build plugins
23:46:00.592    Attempting ruby version 2.7.1, read from environment
23:46:01.861    Using ruby version 2.7.1
23:46:02.173    Using PHP version 5.6
23:46:02.201    5.2 is already installed.
23:46:02.204    Using Swift version 5.2
23:46:02.204    Started restoring cached node modules
23:46:02.206    Finished restoring cached node modules
23:46:02.333    Installing NPM modules using NPM version 6.14.14
23:46:07.919    
23:46:07.919    > esbuild@0.12.20 postinstall /opt/buildhome/repo/node_modules/esbuild
23:46:07.919    > node install.js
23:46:07.919    
23:46:09.169    
23:46:09.169    > svelte-preprocess@4.7.4 postinstall /opt/buildhome/repo/node_modules/svelte-preprocess
23:46:09.169    > echo "[svelte-preprocess] Don't forget to install the preprocessors packages that will be used: node-sass/sass, stylus, less, postcss & postcss-load-config, coffeescript, pug, etc..."
23:46:09.169    
23:46:09.174    [svelte-preprocess] Don't forget to install the preprocessors packages that will be used: node-sass/sass, stylus, less, postcss & postcss-load-config, coffeescript, pug, etc...
23:46:09.309    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
23:46:09.309    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
23:46:09.310    
23:46:09.311    added 316 packages from 284 contributors and audited 320 packages in 6.502s
23:46:09.399    
23:46:09.399    40 packages are looking for funding
23:46:09.399      run `npm fund` for details
23:46:09.399    
23:46:09.400    found 0 vulnerabilities
23:46:09.400    
23:46:09.519    NPM modules installed
23:46:09.718    Installing Hugo 0.54.0
23:46:10.518    Hugo Static Site Generator v0.54.0-B1A82C61A/extended linux/amd64 BuildDate: 2019-02-01T10:04:38Z
23:46:10.519    Started restoring cached go cache
23:46:10.521    Finished restoring cached go cache
23:46:10.910    go version go1.14.4 linux/amd64
23:46:10.913    go version go1.14.4 linux/amd64
23:46:10.921    Installing missing commands
23:46:10.921    Verify run directory
23:46:10.921    Executing user command: npm run build
23:46:11.099    
23:46:11.099    > cuibonobo.com@1.0.0 build /opt/buildhome/repo
23:46:11.099    > svelte-kit build
23:46:11.099    
23:46:11.372    vite v2.4.4 building for production...
23:46:11.659    transforming...
23:46:16.993    Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification
23:46:17.419    ✓ 177 modules transformed.
23:46:17.762    rendering chunks...
23:46:20.359    .svelte-kit/output/client/_app/manifest.json                               3.04kb
23:46:20.385    .svelte-kit/output/client/_app/pages/__error.svelte-412d79b4.js            1.07kb / brotli: 0.55kb
23:46:20.386    .svelte-kit/output/client/_app/pages/__layout.svelte-ea53d3f4.js           1.70kb / brotli: 0.76kb
23:46:20.386    .svelte-kit/output/client/_app/pages/index.svelte-a4609ecb.js              0.44kb / brotli: 0.29kb
23:46:20.386    .svelte-kit/output/client/_app/pages/articles/index.svelte-b4e5dc56.js     1.93kb / brotli: 0.93kb
23:46:20.393    .svelte-kit/output/client/_app/pages/articles/[slug].svelte-54265934.js    1.85kb / brotli: 0.86kb
23:46:20.401    .svelte-kit/output/client/_app/pages/[slug].svelte-da8eaa34.js             1.72kb / brotli: 0.82kb
23:46:20.401    .svelte-kit/output/client/_app/chunks/MetaTitle-03420a73.js                0.34kb / brotli: 0.22kb
23:46:20.401    .svelte-kit/output/client/_app/start-f0acc09d.js                           18.42kb / brotli: 5.73kb
23:46:20.405    .svelte-kit/output/client/_app/pages/ephemera/index.svelte-0e6a461b.js     2.24kb / brotli: 1.04kb
23:46:20.405    .svelte-kit/output/client/_app/assets/start-8077b9bf.css                   0.18kb / brotli: 0.10kb
23:46:20.406    .svelte-kit/output/client/_app/chunks/Markdown-e644abd9.js                 0.41kb / brotli: 0.27kb
23:46:20.413    .svelte-kit/output/client/_app/chunks/fs-83c0cd52.js                       0.88kb / brotli: 0.39kb
23:46:20.432    .svelte-kit/output/client/_app/assets/pages/__layout.svelte-8ce18ff8.css   8.85kb / brotli: 2.18kb
23:46:20.669    .svelte-kit/output/client/_app/chunks/vendor-6a662141.js                   163.11kb / brotli: 44.06kb
23:46:20.677    vite v2.4.4 building SSR bundle for production...
23:46:20.696    file:///opt/buildhome/repo/node_modules/vite-tsconfig-paths/dist/index.mjs:111
23:46:20.697                  done(viteResolve(path2, importer));
23:46:20.697                       ^
23:46:20.697    
23:46:20.697    TypeError: viteResolve is not a function
23:46:20.697        at file:///opt/buildhome/repo/node_modules/vite-tsconfig-paths/dist/index.mjs:111:20
23:46:20.697        at /opt/buildhome/repo/node_modules/tsconfig-paths/lib/match-path-async.js:72:24
23:46:20.697        at /opt/buildhome/repo/node_modules/tsconfig-paths/lib/filesystem.js:46:9
23:46:20.697        at FSReqCallback.oncomplete (fs.js:193:5)
23:46:20.719    npm ERR! code ELIFECYCLE
23:46:20.719    npm ERR! errno 1
23:46:20.722    npm ERR! cuibonobo.com@1.0.0 build: `svelte-kit build`
23:46:20.722    npm ERR! Exit status 1
23:46:20.722    npm ERR! 
23:46:20.723    npm ERR! Failed at the cuibonobo.com@1.0.0 build script.
23:46:20.723    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
23:46:20.744    
23:46:20.744    npm ERR! A complete log of this run can be found in:
23:46:20.744    npm ERR!     /opt/buildhome/.npm/_logs/2021-08-30T03_46_20_723Z-debug.log
23:46:21.600    Failed: build command exited with code: 1
cuibonobo commented 3 years ago

This seems to be related to aleclarson/vite-tsconfig-paths#31.