netlify / netlify-plugin-gatsby

A build plugin to integrate Gatsby seamlessly with Netlify

Home Page:https://www.npmjs.com/package/@netlify/plugin-gatsby

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Error when building in netlify

Nimisoere opened this issue · comments

Summary

───────────────────────────────────────────────────────────────
10:45:43 PM:   3. @netlify/plugin-gatsby (onBuild event)                     
10:45:43 PM: ────────────────────────────────────────────────────────────────
10:45:43 PM: ​
10:45:43 PM: Enabling Gatsby API support
10:45:43 PM: ​
10:45:43 PM: ────────────────────────────────────────────────────────────────
10:45:43 PM:   Plugin "@netlify/plugin-gatsby" internal error                
10:45:43 PM: ────────────────────────────────────────────────────────────────
10:45:43 PM: ​
10:45:43 PM:   Error message
10:45:43 PM:   Error: ENOENT: no such file or directory, copyfile '/opt/build/repo/node_modules/@netlify/plugin-gatsby/src/templates/ipx.ts' -> '.netlify/functions-internal/_ipx.ts'
10:45:43 PM: ​
10:45:43 PM:   Plugin details
10:45:43 PM:   Package:        @netlify/plugin-gatsby
10:45:43 PM:   Version:        3.4.8
10:45:43 PM:   Repository:     git+https://github.com/netlify/netlify-plugin-gatsby.git
10:45:43 PM:   npm link:       https://www.npmjs.com/package/@netlify/plugin-gatsby
10:45:43 PM:   Report issues:  https://github.com/netlify/netlify-plugin-gatsby/issues
10:45:43 PM: ​
10:45:43 PM:   Error location
10:45:43 PM:   In "onBuild" event in "@netlify/plugin-gatsby" from netlify.toml and package.json
10:45:43 PM: ​
10:45:43 PM:   Error properties
10:45:43 PM:   {
10:45:43 PM:     errno: -2,
10:45:43 PM:     code: 'ENOENT',
10:45:43 PM:     syscall: 'copyfile',
10:45:43 PM:     path: '/opt/build/repo/node_modules/@netlify/plugin-gatsby/src/templates/ipx.ts',
10:45:43 PM:     dest: '.netlify/functions-internal/_ipx.ts'
10:45:43 PM:   }
10:45:43 PM: ​


Steps to reproduce

Happens when I deploy to gatsby

versions:

"@netlify/plugin-gatsby": "^3.4.8",
"gatsby-plugin-netlify": "^5.0.1",
"gatsby": "^4.24.0",
"react": "^18.1.0",

A link to a reproduction repository

No response

Plugin version

3.4.8

More information about your build

  • I am building using the CLI
  • I am building using file-based configuration (netlify.toml)

What OS are you using?

Mac OS

Your netlify.toml file

`netlify.toml`
[[plugins]]
  package = "@netlify/plugin-gatsby"

Configuration

`gatsby-config.js` and options
# Paste content of your `gatsby-config.js` file, and/or command line options here. Check there is no private info in there.

Environment

Environment
  System:
    OS: macOS 12.6
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 419.41 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node
    Yarn: 1.22.17 - /usr/local/bin/yarn
    npm: 8.19.2 - ~/.nvm/versions/node/v18.12.1/bin/npm
  Browsers:
    Chrome: 107.0.5304.110
    Safari: 16.0
  npmPackages:
    @netlify/plugin-gatsby: ^3.4.8 => 3.4.8 

Gatsby info

gatsby info
  System:
    OS: macOS 12.6
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.12.1 - ~/.nvm/versions/node/v18.12.1/bin/node
    Yarn: 1.22.17 - /usr/local/bin/yarn
    npm: 8.19.2 - ~/.nvm/versions/node/v18.12.1/bin/npm
  Browsers:
    Chrome: 107.0.5304.110
    Safari: 16.0
  npmPackages:
    gatsby: ^4.24.0 => 4.24.8
    gatsby-omni-font-loader: ^2.0.2 => 2.0.2
    gatsby-plugin-cookiebot: ^1.0.3 => 1.0.3
    gatsby-plugin-create-client-paths: ^4.9.0 => 4.9.0
    gatsby-plugin-fullstory: ^4.24.0 => 4.24.0
    gatsby-plugin-google-analytics: ^4.24.0 => 4.24.0
    gatsby-plugin-google-fonts: ^1.0.1 => 1.0.1
    gatsby-plugin-google-tagmanager: ^4.24.0 => 4.24.0
    gatsby-plugin-image: ^2.24.0 => 2.24.0
    gatsby-plugin-manifest: ^4.24.0 => 4.24.0
    gatsby-plugin-mdx: ^4.3.0 => 4.3.0
    gatsby-plugin-netlify: ^5.0.1 => 5.0.1
    gatsby-plugin-offline: ^5.24.0 => 5.24.0
    gatsby-plugin-postcss: ^5.24.0 => 5.24.0
    gatsby-plugin-react-svg: ^3.3.0 => 3.3.0
    gatsby-plugin-sharp: ^4.24.0 => 4.24.0
    gatsby-plugin-sitemap: ^5.24.0 => 5.24.0
    gatsby-plugin-webpack-bundle-analyser-v2: ^1.1.30 => 1.1.30
    gatsby-source-contentful: ^7.22.0 => 7.22.0
    gatsby-source-filesystem: ^4.24.0 => 4.24.0
    gatsby-transformer-remark: ^5.24.0 => 5.24.0
    gatsby-transformer-sharp: ^4.24.0 => 4.24.0

Your _redirects file

`_redirects`
# Paste content of your `_redirects` file here

Builds logs (or link to your logs)

Build logs
https://app.netlify.com/sites/vtlsuites/deploys/637ff3a74ae5280008653fb2

Function logs

Function logs
# Paste logs here

Thanks for reporting this, @Nimisoere. It seems that the internal functions directory doesn't exist at the point the plugin tries to copy the IPX handler on https://github.com/netlify/netlify-plugin-gatsby/blob/main/plugin/src/helpers/functions.ts#L90, perhaps due to a regression. We will look into it.

Fix is available in v 3.5.1 of the plugin