TylerBarnes / gatsby-plugin-transition-link

A link component for page transitions in gatsby
537 stars 70 forks source link

Build on Zeit.co Now fails due to using layout: require.resolve(`./src/components/layout.js`) #198

Closed hellofantastic closed 4 years ago

hellofantastic commented 4 years ago

So in order to implement a fixed header navigation on scroll I added the config for layout adjustments like so as in docs

{
      resolve: "gatsby-plugin-transition-link",
      options: {
          layout: require.resolve(`./src/components/layout.js`)
        }
    },

But when it comes to deploying on Zeit.co Now zeit has trouble with not finding ./header and ./footer in layout with that config setting, I made sure by taking it out and redeploying and saw that I got a successful build but with a missing navigation ...

Below is with the config in place

 ERROR #98123  WEBPACK
09:44:54.840
Generating JavaScript bundles failed
09:44:54.840
Can't resolve './footer' in '/zeit/255a7df8/src/components'
09:44:54.840
File: src/components/layout.js
09:44:54.843
 ERROR #98123  WEBPACK
09:44:54.843
Generating JavaScript bundles failed
09:44:54.843
Can't resolve './header' in '/zeit/255a7df8/src/components'
09:44:54.843
File: src/components/layout.js

Any possible insight appreciated...

Would adding in footer: require.resolve(`./src/components/footer.js) and for header do the trick?

hellofantastic commented 4 years ago

UPDATE: Adding footer: require.resolve(`./src/components/footer.js) to config does not help it passes in development but fails on prod build

but then I looked at the src in this repo and obviously it wouldn't do anything as your plugin options are specific

hellofantastic commented 4 years ago

UPDATE it also fails manual gatsby build on digital ocean

ERROR #98123  WEBPACK

Generating JavaScript bundles failed

Can't resolve './footer' in '/var/www/site/webapp/src/components'

File: src/components/layout.js

 ERROR #98123  WEBPACK

Generating JavaScript bundles failed

Can't resolve './header' in '/var/www/site/webapp/src/components'

File: src/components/layout.js

not finished run queries - 64.172s
not finished Generating image thumbnails - 64.167s

 ERROR 
hellofantastic commented 4 years ago

capital case filenaming was the issue Mac this works import Header from "./header"; import Footer from './footer';

but not on Linux

I knew about header.js being different from Header.js on linux BUT also if a lowercase file header.j has a capital case export Header ... does not oork