Giter Club home page Giter Club logo

netlify-plugin's Issues

Unhandled onError event during build

I installed the plugin through Netlify UI, configured all according to the blog post about the plugin, but I'm getting build error when deploying my site.

Description

As above.

Steps to Reproduce

I was following the steps from the blog post linked above.

The site is a Create React App project if that's relevant.

Expected Behavior

The build to not fail :)

But if there's a configuration error on my side (e.g. wrong ingest key?), surface that error.

Relevant Logs / Console output

1:12:12 PM: ────────────────────────────────────────────────────────────────
1:12:12 PM:   3. @newrelic/netlify-plugin (onBuild event)                   
1:12:12 PM: ────────────────────────────────────────────────────────────────
1:12:12 PM: ​
1:12:12 PM: ​
1:12:12 PM: ────────────────────────────────────────────────────────────────
1:12:12 PM:   4. @newrelic/netlify-plugin (onError event)                   
1:12:12 PM: ────────────────────────────────────────────────────────────────
1:12:12 PM: ​
1:12:12 PM: ​
1:12:12 PM: (@newrelic/netlify-plugin onError completed in 6ms)
1:12:12 PM: ​
1:12:12 PM: ────────────────────────────────────────────────────────────────
1:12:12 PM:   5. @newrelic/netlify-plugin (onEnd event)                     
1:12:12 PM: ────────────────────────────────────────────────────────────────
1:12:12 PM: ​
1:12:12 PM: ​
1:12:12 PM: (@newrelic/netlify-plugin onEnd completed in 8ms)
1:12:12 PM: ​
1:12:12 PM: ────────────────────────────────────────────────────────────────
1:12:12 PM:   Plugin "@newrelic/netlify-plugin" internal error              
1:12:12 PM: ────────────────────────────────────────────────────────────────
1:12:12 PM: ​
1:12:12 PM:   Error message
1:12:12 PM:   UnhandledRejection: a promise was rejected but not handled: Error: function httpAdapter(config) {
1:12:12 PM:     return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise)...<omitted>...
1:12:12 PM:   } could not be cloned.
1:12:12 PM:     return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise)...<omitted>...
1:12:12 PM:   } could not be cloned.
1:12:12 PM: ​
1:12:12 PM:   Plugin details
1:12:12 PM:   Package:        @newrelic/netlify-plugin
1:12:12 PM:   Version:        1.0.1
1:12:12 PM:   Repository:     git+https://github.com/newrelic-experimental/netlify-plugin.git
1:12:12 PM:   npm link:       https://www.npmjs.com/package/@newrelic/netlify-plugin
1:12:12 PM:   Report issues:  https://github.com/newrelic-experimental/netlify-plugin/issues
1:12:12 PM: ​
1:12:12 PM:   Error location
1:12:12 PM:   In "onBuild" event in "@newrelic/netlify-plugin" from Netlify app
1:12:12 PM:       at writeChannelMessage (node:internal/child_process/serialization:82:9)
1:12:12 PM:       at process.target._send (node:internal/child_process:839:17)
1:12:12 PM:       at process.target.send (node:internal/child_process:739:19)
1:12:12 PM:       at node:internal/util:360:7
1:12:12 PM:       at new Promise (<anonymous>)
1:12:12 PM:       at bound  (node:internal/util:346:12)
1:12:12 PM:       at sendEventToParent (file:///opt/buildhome/node-deps/node_modules/@netlify/build/src/plugins/ipc.js:123:46)
1:12:12 PM:       at handleError (file:///opt/buildhome/node-deps/node_modules/@netlify/build/src/plugins/child/error.js:13:9)
1:12:12 PM:       at Object.handleProcessError [as log] (file:///opt/buildhome/node-deps/node_modules/@netlify/build/src/plugins/child/error.js:31:9)
1:12:12 PM:       at logEvent (file:///opt/buildhome/node-deps/node_modules/log-process-errors/build/src/handle/common.js:53:12)
1:12:12 PM: ​
1:12:12 PM:   Resolved config
1:12:12 PM:   build:
1:12:12 PM:     command: npm run build
1:12:12 PM:     commandOrigin: ui
1:12:12 PM:     environment:
1:12:12 PM:       - ENABLE_BROWSER_MONITORING
1:12:12 PM:       - NEWRELIC_ACCOUNT_ID
1:12:12 PM:       - NEWRELIC_APP_ID
1:12:12 PM:       - NEWRELIC_BROWSER_LICENSE_KEY
1:12:12 PM:       - NEWRELIC_INGEST_LICENSE_KEY
1:12:12 PM:       - REACT_APP_COOKIES_DOMAIN
1:12:12 PM:       - REACT_APP_FB_PIXEL_ID
1:12:12 PM:       - REACT_APP_GRAPHQL_API_ENDPOINT
1:12:12 PM:       - REACT_APP_GRAPHQL_SUBSCRIPTIONS_API_ENDPOINT
1:12:12 PM:       - REACT_APP_GTM_TRACKING_ID
1:12:12 PM:       - REACT_APP_LIVE_MODE
1:12:12 PM:       - REACT_APP_REST_API_ENDPOINT
1:12:12 PM:       - REACT_APP_SEGMENT_API_KEY
1:12:12 PM:       - REACT_APP_SENTRY_DSN
1:12:12 PM:       - SENTRY_AUTH_TOKEN
1:12:12 PM:       - SENTRY_ORG
1:12:12 PM:       - SENTRY_PROJECT
1:12:12 PM:       - SKIP_PREFLIGHT_CHECK
1:12:12 PM:     publish: /opt/build/repo/build
1:12:12 PM:     publishOrigin: ui
1:12:12 PM:   headers:
1:12:12 PM:     - for: /static/*.woff
      values:
        Cache-Control: public, max-age=31536000, immutable
    - for: /static/*.woff2
      values:
        Cache-Control: public, max-age=31536000, immutable
    - for: /*
      values:
        Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
  headersOrigin: config
  plugins:
    - inputs: {}
      origin: ui
      package: '@newrelic/netlify-plugin'
  redirects:
    - from: /*
      status: 200
      to: /index.html

Your Environment

Additional context

Sum of Conditions will be retired on June 30th

This IO Starter will not create NRQL Alerts Conditions if it uses "Sum of" thresholds by June 30th.

Summary

This quick start creates NRQL Alert Conditions whose value function is "Sum of". Note that on June 30th, the Alerts team will disable creation of NRQL conditions using "Sum of" thresholds, and existing "Sum of" conditions will be converted to use Sliding Window Aggregation. https://discuss.newrelic.com/t/end-of-life-for-sum-of-query-results-thresholds/177975

Desired Behavior

Instead of creating "Sum of" conditions, it should create "Sliding window aggregation" conditions. There is a wizard in the Condition Builder showing what the conditions should look like.

Screen Shot 2022-04-25 at 10 25 23 AM

Possible Solution

  • Create Sliding window aggregation conditions instead of "Sum of" conditions.

Additional context

  • This Instant Observability plugin will not create NRQL Alert Conditions well if it continues to use "Sum of" thresholds.

Automate creation of New Relic license keys and IDs

Summary

From a discussion in New Relic internal Slack:

One of the features I would like to add is the ability for users to choose (via the config) to either:

Supply just an app name and a New Relic user key

The plugin would during the build use Nerd Graph to either find the required app ids/license keys, or if not found, create them.

Pro: requires less configuration by the user, more streamlined.
Con: there is no way to persist the keys between builds on Netlify so we would need to look up the keys each build adding a dependency between Netlify and New Relic in order for the build to complete successfully. Any network issues between us and them could cause delayed or even failed builds.

Supply the required ids/keys (the current method)

Same as it is now.

Pro: no dependency between us. No need to make network I/O during builds.
Con: requires more configuration by the user, they probably already need to be a New Relic user to be able to complete configuration smoothly

Tasks

[Repolinter] Open Source Policy Issues

Repolinter Report

🤖This issue was automatically generated by repolinter-action, developed by the Open Source and Developer Advocacy team at New Relic. This issue will be automatically updated or closed when changes are pushed. If you have any problems with this tool, please feel free to open a GitHub issue or give us a ping in #help-opensource.

This Repolinter run generated the following results:

❗ Error ❌ Fail ⚠️ Warn ✅ Pass Ignored Total
0 1 0 5 0 6

Fail #

readme-starts-with-experimental-header #

The README of an experimental project should have an experimental header at the start of the README. If you already have an experimental header and this rule is failing, your header may be out of date, and you should update your header with the suggested one below. For more information please visit https://opensource.newrelic.com/oss-category/. Below is a list of files or patterns that failed:

  • README.md: The first 5 lines do not contain the pattern(s): Open source experimental header (see https://opensource.newrelic.com/oss-category).
    • 🔨 Suggested Fix: prepend [![New Relic Experimental header](https://github.com/newrelic/opensource-website/raw/main/src/images/categories/Experimental.png)](https://opensource.newrelic.com/oss-category/#new-relic-experimental) to file

Passed #

Click to see rules

license-file-exists #

Found file (LICENSE). New Relic requires that all open source projects have an associated license contained within the project. This license must be permissive (e.g. non-viral or copyleft), and we recommend Apache 2.0 for most use cases. For more information please visit https://docs.google.com/document/d/1vML4aY_czsY0URu2yiP3xLAKYufNrKsc7o4kjuegpDw/edit.

readme-file-exists #

Found file (README.md). New Relic requires a README file in all projects. This README should give a general overview of the project, and should point to additional resources (security, contributing, etc.) where developers and users can learn further. For more information please visit https://github.com/newrelic/open-source-tools/tree/master/nerdpacks/oss-template.

readme-contains-link-to-security-policy #

Contains a link to the security policy for this repository (README.md). New Relic recommends putting a link to the open source security policy for your project (https://github.com/newrelic-experimental/<repo-name>/security/policy or ../../security/policy) in the README. For an example of this, please see the "a note about vulnerabilities" section of the Open By Default repository. For more information please visit https://nerdlife.datanerd.us/new-relic/security-guidelines-for-publishing-source-code.

code-of-conduct-should-not-exist-here #

New Relic has moved the CODE_OF_CONDUCT file to a centralized location where it is referenced automatically by every repository in the New Relic organization. Because of this change, any other CODE_OF_CONDUCT file in a repository is now redundant and should be removed. Note that you will need to adjust any links to the local CODE_OF_CONDUCT file in your documentation to point to the central file (README and CONTRIBUTING will probably have links that need updating). For more information please visit https://docs.google.com/document/d/1y644Pwi82kasNP5VPVjDV8rsmkBKclQVHFkz8pwRUtE/view. Did not find a file matching the specified patterns. All files passed this test.

third-party-notices-file-exists #

Found file (THIRD_PARTY_NOTICES.md). A THIRD_PARTY_NOTICES.md file can be present in your repository to grant attribution to all dependencies being used by this project. This document is necessary if you are using third-party source code in your project, with the exception of code referenced outside the project's compiled/bundled binary (ex. some Java projects require modules to be pre-installed in the classpath, outside the project binary and therefore outside the scope of the THIRD_PARTY_NOTICES). Please review your project's dependencies and create a THIRD_PARTY_NOTICES.md file if necessary. For JavaScript projects, you can generate this file using the oss-cli. For more information please visit https://docs.google.com/document/d/1y644Pwi82kasNP5VPVjDV8rsmkBKclQVHFkz8pwRUtE/view.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.