react-firebase-starter
react-firebase-starter copied to clipboard
Publishing to Github Pages
I was attempting to publish to github pages following your docs and was receiving the error: ReferenceError: path is not defined for the code below:
const opts = { cwd: path.resolve(__dirname, './build'), stdio: ['ignore', 'inherit', 'inherit'] };
Is path something I'm supposed to set within this file or could it be something else?
Thank you for taking the time to help!
^ Same error.
seems like you forgot to add something / removed by accident
did you figure out how to fix it? @Jdtanacredi
I think it must be:
const opts = { cwd: path.resolve(__dirname, './public'), stdio: ['ignore', 'inherit', 'inherit'] };
(push the contents of the /public folder to GitHub Pages, that's the folder containing compiled output in the latest version of RSB)
Just have replaced ./build with ./public in GitHub Pages recipes [15e7787]
@Jdtanacredi @ferologics does this fix the issue?
It worked yesterday, then got stuck on a firebase issue (specific to me) and now it doesn't work :/
sorry for the late reply
@koistya full error message -
master@masters-MacBook-Pro ~/F/website> node run publish
Starting 'publish'...
ReferenceError: path is not defined
at tasks.set (/Users/master/Fero/website/run.js:116:23)
at Promise.resolve.then (/Users/master/Fero/website/run.js:31:54)
at process._tickCallback (internal/process/next_tick.js:103:7)
at Module.runMain (module.js:577:11)
at run (bootstrap_node.js:352:7)
at startup (bootstrap_node.js:144:9)
at bootstrap_node.js:467:3
@ferologics Same error. But I just add
const path = require('path');
before and it may work for me. I am not sure whether it is right or not.
lol
@koistya it seems that the javascript doesn't get referenced properly.
https://lifeiscontent.github.io/OpenPoGoUI/
the JS isn't pointing to the correct path.
@lifeiscontent I'm have the same problem?
Failed to load resource: the server responded with a https://USER.github.io/dist/main.47fc5621649d57c92a92.js status of 404 (Not Found)
May be missing project name when npm run build --release for gh-pages.
@ubatin here's my fix https://github.com/kriasoft/react-static-boilerplate/pull/131
@lifeiscontent your patch isn't push to gh-pages. But only build like original. Here is my log with your patch
Starting 'publish'...
Starting 'clean'...
Finished 'clean' after 25ms
Starting 'build'...
Starting 'clean'...
Finished 'clean' after 3ms
Starting 'bundle'...
Time: 17626ms
Asset Size Chunks Chunk Names
0.961903d8d1fe3dc84d04.js 4.41 kB 0 [emitted]
main.47fc5621649d57c92a92.js 504 kB 1 [emitted] main
Finished 'bundle' after 17764ms
Starting 'html'...
Finished 'html' after 5ms
Starting 'sitemap'...
Finished 'sitemap' after 2ms
Finished 'build' after 17774ms
Reopening this old thread. I think that the docs are out of sync with the changes made to the build system.
Editing run.js per the docs yields this after running node run publish:
node run publish
module.js:472
throw err;
^
Error: Cannot find module '/Users/danyim/Developer/artgorithms/run'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:420:7)
at startup (bootstrap_node.js:139:9)
at bootstrap_node.js:535:3