Skip to content

Instantly share code, notes, and snippets.

@pruett
Created May 12, 2021 20:05
Show Gist options
  • Save pruett/edc99fdbab9589b610d4e7d09c1e3430 to your computer and use it in GitHub Desktop.
Save pruett/edc99fdbab9589b610d4e7d09c1e3430 to your computer and use it in GitHub Desktop.
Cloudflare Pages log on `astro build`
19:46:57.536 Initializing build environment. This may take up to a few minutes to complete
19:47:34.532 Success: Finished initializing build environment
19:47:34.532 Cloning repository...
19:47:38.354 Success: Finished cloning repository files
19:47:39.317 Installing dependencies
19:47:39.333 Python version set to 2.7
19:47:42.805 v12.18.0 is already installed.
19:47:43.287 Now using node v12.18.0 (npm v6.14.4)
19:47:43.315 Started restoring cached build plugins
19:47:43.327 Finished restoring cached build plugins
19:47:43.719 Attempting ruby version 2.7.1, read from environment
19:47:45.205 Using ruby version 2.7.1
19:47:45.608 Using PHP version 5.6
19:47:45.651 5.2 is already installed.
19:47:45.656 Using Swift version 5.2
19:47:45.656 Started restoring cached node modules
19:47:45.658 Finished restoring cached node modules
19:47:45.840 Installing NPM modules using NPM version 6.14.4
19:47:48.017 npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
19:47:56.291
19:47:56.291 > esbuild@0.10.2 postinstall /opt/buildhome/repo/node_modules/esbuild
19:47:56.291 > node install.js
19:47:56.291
19:47:57.354
19:47:57.355 > esbuild@0.9.7 postinstall /opt/buildhome/repo/node_modules/snowpack/node_modules/esbuild
19:47:57.355 > node install.js
19:47:57.355
19:47:58.403
19:47:58.403 > svelte-preprocess@4.7.3 postinstall /opt/buildhome/repo/node_modules/svelte-preprocess
19:47:58.403 > 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..."
19:47:58.403
19:47:58.411 [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...
19:47:59.005 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/snowpack/node_modules/rollup/node_modules/fsevents):
19:47:59.005 npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
19:47:59.005 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
19:47:59.005 npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
19:47:59.005
19:47:59.005 added 447 packages from 316 contributors and audited 450 packages in 11.011s
19:47:59.217
19:47:59.217 77 packages are looking for funding
19:47:59.217 run `npm fund` for details
19:47:59.217
19:47:59.217 found 0 vulnerabilities
19:47:59.217
19:47:59.252 NPM modules installed
19:47:59.750 Installing Hugo 0.54.0
19:48:00.771 Hugo Static Site Generator v0.54.0-B1A82C61A/extended linux/amd64 BuildDate: 2019-02-01T10:04:38Z
19:48:00.774 Started restoring cached go cache
19:48:00.777 Finished restoring cached go cache
19:48:01.222 go version go1.14.4 linux/amd64
19:48:01.224 go version go1.14.4 linux/amd64
19:48:01.235 Installing missing commands
19:48:01.235 Verify run directory
19:48:01.235 Executing user command: npm run build
19:48:02.028
19:48:02.028 > kevinpruett.com@1.0.0 build /opt/buildhome/repo
19:48:02.028 > astro build
19:48:02.028
19:48:02.057 (node:1528) ExperimentalWarning: The ESM module loader is experimental.
19:48:02.138 file:///opt/buildhome/repo/node_modules/astro/dist/cli.js:11
19:48:02.139 `)}var oo={debug:M.bind(null,z),info:y.bind(null,z),warn:wt.bind(null,z),error:j.bind(null,z)};function St(t=()=>{}){let e=console.warn;return console.warn=function(...r){t(...r)},()=>console.warn=e}function ye(t,e){let r=ge(t);if(r>e)return t.substring(0,e-3)+"...";let o=Array.from({length:e-r},()=>" ").join("");return t+o}import"source-map-support/register.js";import{fileURLToPath as B}from"url";import"source-map-support/register.js";import{existsSync as he}from"fs";import Rt from"path";import{fileURLToPath as we}from"url";import{fdir as be}from"fdir";function tt(t,e){for(let r of t){let o=new URL(`./pages/${r}`,e);if(he(o))return{fileURL:o,snowpackURL:`/_astro/pages/${r}.js`}}return!1}function vt(t,e){let r=decodeURI(t.pathname),o=r.substr(1);if(r.endsWith("/")){let c=[`${o}index.astro`,`${o}index.md`],s=tt(c,e);if(s)return{statusCode:200,location:s,pathname:r}}else{let c=[`${o}.astro`,`${o}.md`],s=tt(c,e);if(s)return{statusCode:200,location:s,pathname:r}}let i=[`${o}/index.astro`,`${o}/index.md`],n=tt(i,e);if(n)return{statusCode:301,location:null,pathname:r+"/"};let a=!!Rt.extname(r);if(!n&&!a){let c=xe(r,e);if(c)return{statusCode:200,location:c.location,pathname:r,currentPage:c.currentPage||1}}return r==="/500"?{statusCode:200,location:{fileURL:new URL("./frontend/500.astro",import.meta.url),snowpackURL:"/_astro_internal/500.astro.js"},pathname:r}:{statusCode:404}}var Se=new be;function xe(t,e){let r=Se.glob("**/*").crawl(Rt.join(we(e),"pages")).sync().filter(o=>o.startsWith("$")||o.includes("/$"));for(let o of r){let i=new RegExp("^/"+o.replace(/\$([^/]+)\.astro/,"$1")+"/?(.*)"),n=t.match(i);if(n){let a;if(n[1]){let c=n[1].split("/").filter(s=>!!s);if(c.length){let s=c.pop();parseInt(s,10)&&(a=parseInt(s,10))}}return{location:{fileURL:new URL(`./pages/${o}`,e),snowpackURL:`/_astro/pages/${o}.js`},currentPage:a}}}}import{existsSync as Re}from"fs";import{loadConfiguration as ve,logger as Ce,startServer as $e}from"snowpack";import{createRequire as ke}from"module";var et=ke(import.meta.url);Ce.level="silent";async function Le(t,e){let{logging:r,backendSnowpackRuntime:o,frontendSnowpack:i}=t,{astroRoot:n}=t.astroConfig,a=new URL(e||"/","https://example.org/"),c=decodeURI(a.pathname);y(r,"access",c);let s=vt(a,n);if(s.statusCode===404)try{let u=await i.loadUrl(c);if(!u)throw new Error(`Unable to load ${c}`);return L({statusCode:200},u)}catch(u){return u.failed?{statusCode:500,type:"unknown",error:u}:{statusCode:404,error:u}}if(s.statusCode===301)return{statusCode:301,location:s.pathname};let p=s.location.snowpackURL,l={};try{let u=await o.importModule(p);M(r,"resolve",`${c} -> ${p}`);let m={},d=new Set;if(u.exports.createCollection){let g=await u.exports.createCollection();for(let x of Object.keys(g))if(x!=="data"&&x!=="routes"&&x!=="permalink"&&x!=="pageSize"&&x!=="rss")throw new Error(`[createCollection] unknown option: "${x}"`);let{data:$,routes:f,permalink:S,pageSize:w,rss:E}=g;w||(w=25);let R={};if(f||S){if(!f||!S)throw new Error("createCollection() must have both routes and permalink options. Include both together, or omit both.");let x=f.find(k=>{let P=S({params:k});return d.add(P),P===c||`${P}/${s.currentPage||1}`===c});x&&(R=x,m.params=x)}let v=await $({params:R});if(E&&(l=L(L({},E),{data:[...v]})),m.start=0,m.end=v.length-1,m.total=v.length,m.page={current:1,size:w,last:1},m.url={current:c},s.currentPage){let x=(s.currentPage-1)*w,k=Math.min(x+w,v.length);m.start=x,m.end=k-1,m.page.current=s.currentPage,m.page.last=Math.ceil(v.length/w),k<v.length&&(m.url.next=m.url.current.replace(/(\/\d+)?$/,`/${s.currentPage+1}`)),s.currentPage>1&&(m.url.prev=m.url.current.replace(/\d+$/,`${s.currentPage-1||1}`).replace(/\/1$/,""));for(let P=1;P<=m.page.last;P++)d.size?d.forEach(Y=>{d.add(Y.replace(/(\/\d+)?$/,`/${P}`))}):d.add(c.replace(/(\/\d+)?$/,`/${P}`));v=v.slice(x,k)}else if(g.pageSize)return{statusCode:301,location:c+"/1",collectionInfo:{additionalURLs:d,rss:l.data?l:void 0}};if(!v.length)return{statusCode:404,error:new Error("Not Found"),collectionInfo:{additionalURLs:d,rss:l.data?l:void 0}};m.data=v}let h=new URL(a.toString());c!=="/500"&&(h.search="");let b=await u.exports.__renderPage({request:{url:h},children:[],props:{collection:m}}),U=Array.isArray(u.css)&&u.css.length?u.css.reduce((g,$)=>`${g}
19:48:02.168
19:48:02.168 SyntaxError: The requested module 'snowpack' does not provide an export named 'startServer'
19:48:02.168 at ModuleJob._instantiate (internal/modules/esm/module_job.js:92:21)
19:48:02.168 at async ModuleJob.run (internal/modules/esm/module_job.js:107:20)
19:48:02.169 at async Loader.import (internal/modules/esm/loader.js:179:24)
19:48:02.169 npm ERR! code ELIFECYCLE
19:48:02.169 npm ERR! errno 1
19:48:02.169 npm ERR! kevinpruett.com@1.0.0 build: `astro build`
19:48:02.169 npm ERR! Exit status 1
19:48:02.169 npm ERR!
19:48:02.169 npm ERR! Failed at the kevinpruett.com@1.0.0 build script.
19:48:02.169 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
19:48:02.173
19:48:02.173 npm ERR! A complete log of this run can be found in:
19:48:02.173 npm ERR! /opt/buildhome/.npm/_logs/2021-05-10T23_48_02_142Z-debug.log
19:48:02.177 Failed: build command exited with code: 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment