Function works perfectly when:
- Running in my local environment using
netlify dev
- Deployed via
netlify deploy
- Running a similar setup in other web apps I’ve worked on like https://95-percent.netlify.app/.netlify/functions/questions
Function doesn’t work when: deploying automatically via GitHub
Source repository: GitHub - vdsabev/google-docs-viewer-example: Wanna learn how to embed a responsive Google Doc in a website? Look no further!
Failing function URL: https://google-docs-viewer.netlify.app/.netlify/functions/document/2PACX-1vT6_yEVCSJJHoiZAFOtoQYEh3A-qmLPW-ESjoyjYRgizhOVdOgsbhzzV8FhKNc3xJVidawPcuuFH87W
Latest publish log (cleared cache, no build step used):
1:03:54 AM: Build ready to start
1:03:55 AM: build-image version: b0258b965567defc4a2d7e2f2dec2e00c8f73ad6
1:03:55 AM: build-image tag: v3.4.1
1:03:55 AM: buildbot version: c6376102eedf4be6c6e5d685c7141e2eb612d47d
1:03:55 AM: Building without cache
1:03:55 AM: Starting to prepare the repo for build
1:03:56 AM: No cached dependencies found. Cloning fresh repo
1:03:56 AM: git clone https://github.com/vdsabev/google-docs-viewer-example
1:03:56 AM: Preparing Git Reference refs/heads/master
1:03:58 AM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'public' versus '/' in the Netlify UI
1:03:58 AM: Different functions path detected, going to use the one specified in the Netlify configuration file: 'api' versus '' in the Netlify UI
1:03:58 AM: No build command found, continuing to publishing
1:03:58 AM: Starting to deploy site from 'public'
1:03:58 AM: Creating deploy tree
1:03:58 AM: Creating deploy upload records
1:03:58 AM: 0 new files to upload
1:03:58 AM: 0 new functions to upload
1:03:58 AM: Starting post processing
1:03:58 AM: Post processing - HTML
1:03:58 AM: Finished processing build request in 3.209823701s
1:03:58 AM: Post processing - header rules
1:03:58 AM: Post processing - redirect rules
1:03:59 AM: Post processing done
1:03:59 AM: Site is live
Solutions attempted (and failed):
- Moved
/package.json
to/api/package.json
- Moved
/package.json
to/api/document/package.json
and/api/document.js
to/api/document/document.js
- Added
npm install
asprebuild
script inpackage.json
- Added
npm install
asbuild
script inpackage.json
I can’t think of anything special I’m doing with this project, or why it won’t work. Any suggestions?