netlify-plugin-inline-functions-env icon indicating copy to clipboard operation
netlify-plugin-inline-functions-env copied to clipboard

Inlining all files in node_modules folder

Open robnewton opened this issue 4 years ago • 0 comments

This takes a few minutes to run and eventually fails with an error that too many files are open. The console shows that it is "inlining" the entire node_modules directory tree. According to the docs it's supposed to only work on functions.

Any ideas what's going on with it scanning the node_modules directory?

Here's the relevant netlify.toml

...
functions = "functions"

[[plugins]]
package = "netlify-plugin-inline-functions-env"

[[redirects]]
...

EDIT: I just noticed that it erased the contents of all function js files as well.

Here's a clip from the part of the logs where it fails

...
inlining C:\Users\Rob\Documents\GitHub\project\node_modules\oauth-1.0a\test\options\realm.js
inlining C:\Users\Rob\Documents\GitHub\project\node_modules\oauth-1.0a\test\options\signature_method.js       
inlining C:\Users\Rob\Documents\GitHub\project\node_modules\oauth-1.0a\test\services\bitbucket.js
inlining C:\Users\Rob\Documents\GitHub\project\node_modules\oauth-1.0a\test\services\flickr.js
inlining C:\Users\Rob\Documents\GitHub\project\node_modules\oauth-1.0a\test\services\openbank.js
inlining C:\Users\Rob\Documents\GitHub\project\node_modules\oauth-1.0a\test\services\twitter.js
inlining C:\Users\Rob\Documents\GitHub\project\node_modules\oauth-1.0a\test\twitter_sample_data.js

────────────────────────────────────────────────────────────────
  Plugin "netlify-plugin-inline-functions-env" failed
────────────────────────────────────────────────────────────────

  Error message
  Error: Failed to inline function files due to the following error:
  EMFILE: too many open files, open 'C:\Users\Rob\Documents\GitHub\project\node_modules\lodash\_baseFlatten.js'
  EMFILE: too many open files, open 'C:\Users\Rob\Documents\GitHub\project\node_modules\lodash\_baseFlatten.js'

  Plugin details
  Package:        netlify-plugin-inline-functions-env
  Version:        1.0.8
  npm link:       https://www.npmjs.com/package/netlify-plugin-inline-functions-env
  Report issues:  https://github.com/bencao/netlify-plugin-inline-functions-env/issues

  Error location
  In "onPreBuild" event in "netlify-plugin-inline-functions-env" from netlify.toml

  Resolved config
  build:
    command: npm run build
    commandOrigin: config
    functions: C:\Users\Rob\Documents\GitHub\project\functions
    publish: C:\Users\Rob\Documents\GitHub\project\build
  plugins:
    - inputs: {}
      origin: config
      package: netlify-plugin-inline-functions-env
  redirects:
    - force: true

robnewton avatar Jan 25 '21 05:01 robnewton