react-firebase-starter icon indicating copy to clipboard operation
react-firebase-starter copied to clipboard

Publishing to Github Pages

Open Jdtanacredi opened this issue 9 years ago • 13 comments

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!

Jdtanacredi avatar Jul 26 '16 19:07 Jdtanacredi

^ Same error.

seems like you forgot to add something / removed by accident

did you figure out how to fix it? @Jdtanacredi

ferologics avatar Jul 27 '16 06:07 ferologics

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)

koistya avatar Jul 27 '16 14:07 koistya

Just have replaced ./build with ./public in GitHub Pages recipes [15e7787]

koistya avatar Jul 27 '16 14:07 koistya

@Jdtanacredi @ferologics does this fix the issue?

koistya avatar Jul 28 '16 15:07 koistya

It worked yesterday, then got stuck on a firebase issue (specific to me) and now it doesn't work :/

sorry for the late reply

ferologics avatar Jul 30 '16 15:07 ferologics

@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 avatar Jul 30 '16 17:07 ferologics

@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.

Impavidity avatar Aug 04 '16 10:08 Impavidity

lol

ferologics avatar Aug 04 '16 14:08 ferologics

@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 avatar Aug 13 '16 16:08 lifeiscontent

@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.

lwinkyawmyat avatar Sep 26 '16 16:09 lwinkyawmyat

@ubatin here's my fix https://github.com/kriasoft/react-static-boilerplate/pull/131

lifeiscontent avatar Sep 27 '16 13:09 lifeiscontent

@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

lwinkyawmyat avatar Sep 27 '16 14:09 lwinkyawmyat

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

danyim avatar Mar 13 '17 17:03 danyim