Created
July 2, 2019 16:25
-
-
Save evdama/b963d816dc67c93882c0987a966bd50d to your computer and use it in GitHub Desktop.
error when uploading sapper project to firebase (seems like sirv can't find the static dir?)
This file contains 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
// @ts-nocheck TODO: remove at some point | |
// TODO: what todo with those two imports? needed? if so why and how? | |
//import config from './config'; | |
//import './css/index.css'; | |
import sirv from 'sirv'; | |
import polka from 'polka'; | |
import compression from 'compression'; | |
import * as sapper from '@sapper/server'; | |
const { | |
PORT, | |
NODE_ENV | |
} = process.env; | |
const dev = NODE_ENV === 'development'; | |
polka() | |
.use( | |
compression( { | |
threshold: 0 | |
} ), | |
sirv( 'static', { | |
dev | |
} ), | |
sapper.middleware( { | |
session: ( req, res ) => { | |
return {} | |
} | |
}) | |
) | |
.listen( PORT, err => { | |
if ( err ) console.log( 'error', err ); | |
} ); | |
I get this error when running 'firebase deploy' | |
for this sapper project | |
sa @mbp: ~/0/edm | master U: 4✗ | firebase deploy | |
=== | |
Deploying to 'evdama-db8d0'... | |
i deploying storage, firestore, functions, hosting | |
Running command: node predeploy.js | |
copying build folder to functions✔ functions: Finished running predeploy script. | |
i storage: checking config / storage.rules | |
for compilation errors...✔storage: rules file config / storage.rules compiled successfully | |
i firestore: checking config / firestore.rules | |
for compilation errors... | |
i firestore: reading indexes from config / firestore.indexes.json...✔firestore: rules file config / firestore.rules compiled successfully | |
i functions: ensuring necessary APIs are enabled...✔functions: all necessary APIs are enabled | |
i storage: uploading rules config / storage.rules... | |
i firestore: uploading rules config / firestore.rules...✔firestore: deployed indexes in config / firestore.indexes.json successfully | |
i functions: preparing functions directory | |
for uploading... | |
i functions: packaged functions( 634 KB ) for uploading✔ functions: functions folder uploaded successfully | |
i hosting[ evdama - db8d0 ]: beginning deploy... | |
i hosting[ evdama - db8d0 ]: found 4 files in static✔ hosting[ evdama - db8d0 ]: file upload complete✔ storage: released rules config / storage.rules to firebase.storage / evdama - db8d0.appspot.com✔ firestore: released rules config / firestore.rules to cloud.firestore | |
i functions: updating Node.js 10( Beta ) | |
function ssr( us - central1 )...⚠functions[ ssr( us - central1 ) ]: Deployment error. | |
Function failed on loading user code.Error message: Provided module can 't be loaded. | |
Is there a syntax error in your code ? | |
Detailed stack trace : Error: ENOENT: no such file or directory, scandir '/srv/functions/static' | |
at Object.readdirSync( fs.js: 785: 3 ) | |
at list( /srv/functions / node_modules / sirv / index.js: 38: 15 ) | |
at module.exports( /srv/functions / node_modules / sirv / index.js: 100: 2 ) | |
at Object. < anonymous > ( /srv/functions / __sapper__ / build / server / server.js: 2695: 3 ) | |
at Module._compile( internal / modules / cjs / loader.js: 701: 30 ) | |
at Object.Module._extensions..js( internal / modules / cjs / loader.js: 712: 10 ) | |
at Module.load( internal / modules / cjs / loader.js: 600: 32 ) | |
at tryModuleLoad( internal / modules / cjs / loader.js: 539: 12 ) | |
at Function.Module._load( internal / modules / cjs / loader.js: 531: 3 ) | |
at Module.require( internal / modules / cjs / loader.js: 637: 17 ) | |
Could not load the | |
function, shutting down. | |
Functions deploy had errors with the following functions: | |
ssr | |
To | |
try redeploying those functions, run: | |
firebase deploy--only functions: ssr | |
To | |
continue deploying other features( such as database ), run: | |
firebase deploy--except functions | |
Error: Functions did not deploy properly. | |
Having trouble ? Try firebase deploy--help | |
sa @mbp: ~/0/edm | master U: 5✗ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment