question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add additional context to plugin error message

See original GitHub issue

Current message:

┌─────────────────────────────┐
│     Netlify Build Error     │
└─────────────────────────────┘

In "onInit" command from "plugin-one":
ReferenceError: yolo is not defined
    at onInit (/plugins/one/index.js:40:19)
    at Object.run (/Users/davidwells/.nvm/versions/node/v10.4.1/lib/node_modules/netlify-cli/node_modules/@netlify/build/src/plugins/child/main.js:72:9)
    at handleEvent (/Users/davidwells/.nvm/versions/node/v10.4.1/lib/node_modules/netlify-cli/node_modules/@netlify/build/src/plugins/child/main.js:54:43)
    at getEventsFromParent (/Users/davidwells/.nvm/versions/node/v10.4.1/lib/node_modules/netlify-cli/node_modules/@netlify/build/src/plugins/child/main.js:50:61)
    at process.on (/Users/davidwells/.nvm/versions/node/v10.4.1/lib/node_modules/netlify-cli/node_modules/@netlify/build/src/plugins/ipc.js:73:15)

We should update this message with additional context on how the user can self serve and potentially report issues back to the original plugin author.

Using the information (if available) in package.json, we should update the message to what is shown below

Updated message:

┌─────────────────────────────┐
│     Netlify Build Error     │
└─────────────────────────────┘

In the "plugin-one" plugin the "onInit" command is failing with this error:
ReferenceError: yolo is not defined
    at onInit (/plugins/one/index.js:40:19)
    at Object.run (/Users/davidwells/.nvm/versions/node/v10.4.1/lib/node_modules/netlify-cli/node_modules/@netlify/build/src/plugins/child/main.js:72:9)
    at handleEvent (/Users/davidwells/.nvm/versions/node/v10.4.1/lib/node_modules/netlify-cli/node_modules/@netlify/build/src/plugins/child/main.js:54:43)
    at getEventsFromParent (/Users/davidwells/.nvm/versions/node/v10.4.1/lib/node_modules/netlify-cli/node_modules/@netlify/build/src/plugins/child/main.js:50:61)
    at process.on (/Users/davidwells/.nvm/versions/node/v10.4.1/lib/node_modules/netlify-cli/node_modules/@netlify/build/src/plugins/ipc.js:73:15)

> Plugin details <
Name: plugin-one
Versions: 0.2.1
Github link: https://github.com/davidwells/plugin-one
Npm link: https://npm.com/plugin-one
Report issues: https://github.com/davidwells/plugin-one/issues

┌─────────────────────────────┐
│     End Build Error Message                            │
└─────────────────────────────┘

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
foolcommented, Feb 17, 2020

wow, that’s great! Thanks!

0reactions
ehmickycommented, Feb 25, 2020

The test snapshots have changed due to updates to the test logic, but the actual log output users see has remained very similar to the above screenshot. Some minor improvements have come with the introduction of the new utils.build.* error reporting methods (#735). No output information was removed in the process.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add sufficient context when letting user report errors #283
Currently every single time I encountered this I pretty much had to go into the source and add panics to framework code and...
Read more >
Error handling - Apollo GraphQL Docs
Custom errors can provide additional context, enabling your clients to understand why an error is happening. We recommend making clear errors for common ......
Read more >
Troubleshoot user errors with Office Add-ins - Microsoft Learn
Enter the URL that appears in the error message, and choose Add. Try to use the add-in again. If the problem persists, verify...
Read more >
[error] Drupal\Component\Plugin\Exception\ContextException
Found this error with ctools 3.10. In addition to breaking node edit forms on all content types as well as content/add, also breaks...
Read more >
Plugin Error - Microsoft Dynamics CRM Forum Community ...
You can see the ErrorMessage : Specified cast is not valid. It means what it means : you are trying to put a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found