Giter Club home page Giter Club logo

vscode-notebook-error-overlay's Introduction

vscode-notebook-error-overlay

This provides a Notebook-aware error overlay, somewhat like that which create-react-app provides. This is used in our renderer starter.

Usage

First, install it:

npm i --save-dev vscode-notebook-error-overlay

Then in your notebook's render function:

import errorOverlay from 'vscode-notebook-error-overlay';

function renderOutput(domNode) {
  // When you render in an element, install the overlay in it:
  errorOverlay.install(domNode);

  renderMyOutput(domNode); // then render your output
}

You can alternatively install and render in a wrapped function, which has the advantage of displaying any errors synchronously thrown from the render() function:

import errorOverlay from 'vscode-notebook-error-overlay';

const renderOutput = domNode => errorOverlay.wrap(domNode, () => {
  renderMyOutput(domNode);
});

If any build errors happen when running from the webpack-dev-server, an appropriate error message will be shown wherever the overlay is installed.

vscode-notebook-error-overlay's People

Contributors

connor4312 avatar dependabot[bot] avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-notebook-error-overlay's Issues

Webpack can't resolve overlay

After taking a look at the React Notebook sample, available here

I mimicked the code they used to my own project, which is a notebook visualiser by the way, ( as I was not able to make React work ) but it did not work for me because of a Webpack error that happened :

`ERROR in ./node_modules/vscode-notebook-error-overlay/dist/index.js 4:0-48
Module not found: Error: Can't resolve './overlay' in 'C:...\project\node_modules\vscode-notebook-error-overlay\dist'
resolve './overlay' in 'C:...\project\node_modules\vscode-notebook-error-overlay\dist'
using description file: C:...\project\node_modules\vscode-notebook-error-overlay\package.json (relative path: ./dist)
Field 'browser' doesn't contain a valid alias configuration
using description file: C:...\project\node_modules\vscode-notebook-error-overlay\package.json (relative path: ./dist/overlay)
no extension
Field 'browser' doesn't contain a valid alias configuration
.tsx
Field 'browser' doesn't contain a valid alias configuration
C:...\project\node_modules\vscode-notebook-error-overlay\dist\overlay.tsx doesn't exist
.css
Field 'browser' doesn't contain a valid alias configuration
C:...\project\node_modules\vscode-notebook-error-overlay\dist\overlay.css doesn't exist
as directory
C:...\project\node_modules\vscode-notebook-error-overlay\dist\overlay doesn't exist
@ ./src/renderer/index.tsx 3:0-57 44:12-29

webpack 5.82.0 compiled with 1 error in 2057 ms`

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.