Code Monkey home page Code Monkey logo

Comments (4)

kaichehung avatar kaichehung commented on August 15, 2024 1

this could be an option

https://observablehq.com/@observablehq/how-to-embed-a-notebook-in-a-react-app

from fire-elect.

ychi avatar ychi commented on August 15, 2024

Really cool! We can develop interactive charts in Observable and embed them into react

from fire-elect.

ychi avatar ychi commented on August 15, 2024

Tried to add a notebook to react app, kept seeing the following error even if I added @babel/plugin-syntax-import-meta:
./node_modules/@observablehq/downloading-and-embedding-notebooks/[email protected] SyntaxError: ~/pretty-animation/node_modules/@observablehq/downloading-and-embedding-notebooks/[email protected]: Support for the experimental syntax 'importMeta' isn't currently enabled (4:206): ... Add @babel/plugin-syntax-import-meta (https://git.io/vbKK6) to the 'plugins' section of your Babel config to enable parsing.

What I tried:

  1. adding a babel property into package.json:
    "babel": { "plugins": [ "@babel/plugin-syntax-import-meta" ] },

  2. using react-app-rewired:
    (https://medium.com/manato/introduce-babel-new-plugins-to-create-react-app-ea55f56c3811)
    And putting this in .babelrc
    "plugins": [ "@babel/plugin-syntax-import-meta" ]

When I intentionally misspell the plugin name, the complain becomes Error: Cannot find module 'babel-plugin-plugin-syntax-import-meta'

Current suspicion is it has to do with babel 7 (https://babeljs.io/docs/en/config-files#6x-vs-7x-babelrc-loading). The blog post over in observable was back in May 2018, while babel 7 was released in August 2018.

from fire-elect.

hawknguyen189 avatar hawknguyen189 commented on August 15, 2024

have the same problem when trying to embed a notebook into react

from fire-elect.

Related Issues (20)

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.